init.lua 304 B

123456789101112131415161718
  1. Random={}
  2. local seed=os.time({year=0,month=0,day=0,sec=0})
  3. local psRa=PseudoRandom(seed)
  4. local count=0
  5. local abs=0
  6. function Random:next(min,max)
  7. local tmp=psRa:next(min,max)
  8. count=count+1
  9. abs=abs+math.abs(tmp)
  10. if count>20000 then
  11. psRa=PseudoRandom(seed+abs)
  12. count=0
  13. abs=0
  14. end
  15. return tmp
  16. end