hello, who are u?
can u give me a reason please?
re: Halflife2 leak source的在线浏览版本 hello delete this article plz 2006-09-21 15:04
hello delete this article plz
re: lua5.1中的random "齐柏林飞艇"迷上了"哥特金属" 2006-05-21 21:49
我用的是os.time()作为种子。所以并不是相同的随机种子啊!
re: lua5.1中的random 失忆的猪猪 2006-05-19 17:06
正好在作项目用lua也碰到类似的问题,搜索到了这里,原来你也遇到这个问题了,后来翻了翻lua的手册,发现里面这样写
The functions math.random and math.randomseed are interfaces to the simple random generator functions rand and srand that are provided by ANSI C. (No guarantees can be given for their statistical properties.) When called without arguments, math.random returns a pseudo-random real number in the range [0,1). When called with a number n, math.random returns a pseudo-random integer in the range [1,n]. When called with two arguments, l and u, math.random returns a pseudo-random integer in the range [l,u]. The math.randomseed function sets a "seed" for the pseudo-random generator: Equal seeds produce equal sequences of numbers.
原来lua设计的随机数就是提供伪随机数,Equal seeds produce equal sequences of numbers. 相同的随机种子产生的随机数列是相同的
呵呵,希望对你有所帮助
re: lua5.1中的random xylx 2006-04-04 16:02
测试过了,的确都是相同的随机数,那就不能叫随机数了;不过那只是在某一小段时间内的结果,如果你等待时间久一点再运行第二次的话,就得到不同的数了;但是这的确是个不大不小的问题。