Module:IncognitoTestLua2

From Wikipedia

Documentation for this module may be created at Module:IncognitoTestLua2/doc

local p = {}

function p.internal(msg, frame)
	local args = frame:getParent().args
	
	local repet = tonumber(args[2])
	if (repet < 0) then
		error('argument négatif')
	elseif (repet > 10) then
		error('trop de répétitions')
	else
		local result = {}
		for iter = 1, repet do
			table.insert(result, '* ' .. msg .. args[1] .. ' ! ' .. args.bar .. ' & ' .. args.baz)
		end
		return table.concat(result, '\n')
	end
end

return p