Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Test2: Difference between revisions

From ProleWiki, the proletarian encyclopedia
(Testing method for random number generator)
 
m (Accepting arguments)
Line 1: Line 1:
local p = {}
local p = {}


function p.randomNumber(x,y)
function p.randomNumber(frame)
return math.random(x,y)
local min = tonumber(frame.args[1]) or 0
local max = tonumber(frame.args[2]) or 100
return math.random(min, max)
end
end


return p
return p

Revision as of 01:19, 18 February 2023

local p = {}

function p.randomNumber(frame)
	local min = tonumber(frame.args[1]) or 0
	local max = tonumber(frame.args[2]) or 100
	return math.random(min, max)
end

return p