Module:Random: Difference between revisions

Content deleted Content added
attempt at getting better randomness
tidy indents and remove confusing left-over comment
Line 30:
local function bigRandom(l, u)
-- Gets a random integer between l and u, and is not limited to RAND_MAX (which here we assume is 2^31-1).
local r = math.random() + math.random() / 2147483648
return math.floor(r * (u - l + 1)) + l
end
 
Line 141:
local ret = {}
for k, v in pairs(t) do
if type(k) == 'number' then -- Make sure we have no non-string portal names.
table.insert(ret, k)
end