Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
generate lua safe random numbers
for i = 1, 10000 do
local t = os.time()
local c = os.clock()
local seed = t + (c*1000000)
math.randomseed(seed)
print(t, c, seed, math.random(1, 2147483647))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment