Why is the first random number always the same on some platforms in lua?

前端 未结 5 1030
眼角桃花
眼角桃花 2021-01-18 15:50

Consider the following lua code snippet :

local time = os.time()
for _= 1, 10 do
    time = time + 1
    print(\'Seeding with \' .. time)
    math.randomseed         


        
5条回答
  •  鱼传尺愫
    2021-01-18 16:12

    Check these links out.

    http://lua-users.org/lists/lua-l/2007-03/msg00564.html

    http://lua-users.org/lists/lua-l/2007-03/msg00572.html

提交回复
热议问题