Lua math.random problem

Ah, I see. Well, hmm, if you throw away the first one or two random numbers you start to get the kind of variation that is to be expected:

-- os.time() seems to work equally well
math.randomseed(socket.gettime()) math.random() math.random()
print(math.random(1,3))

Not optimal. Perhaps we can deal with this better internally in the engine…

1 Like