Jump to content

Module:If any equal: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
main
No edit summary
Line 4: Line 4:
p.main = function(frame)
p.main = function(frame)
local match = false
local match = false
for name, value in pairs(args) do
for name, value in pairs(frame.args) do
if name:match('^%d+$') and value==frame.args.value then
if name:match('^%d+$') and value==frame.args.value then
match = true
match = true

Revision as of 09:50, 20 December 2023

require('strict')
local p = {}

p.main = function(frame)
	local match = false
	for name, value in pairs(frame.args) do
		if name:match('^%d+$') and value==frame.args.value then
			match = true
			break
		end
	end
	return match and 'yes' or 'no'
end

return p