Module:Random

-- Module call from Template:Random Number -- Note: The seed should not exceed the integer limit! local function generateRandomNumber( frame ) local args = require("Module:Args").getCleanArgs local seed, lo, up = args[1], args[2], args[3] seed = tonumber(seed) assert(seed, "`seed` is not a number") math.randomseed(seed) if lo then lo = tonumber(lo) assert(lo, "`lower` is not a number") if up then up = tonumber(up) assert(up, "`upper` is not a number") return math.random(lo, up) else return math.random(lo) end else return math.random end end

return { generateRandomNumber = generateRandomNumber, }