【发布时间】:2015-08-18 22:48:54
【问题描述】:
我的问题是当我写 math.random(10) 它实际上并不是随机的,它总是给我输出:
1
6
2
9
如果我用过例如:
local colors = {"ORANG","BLUE","RED","YELLOW","BLACK"}
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
print(colors[math.random(#colors)])
os.execute 'pause'
输出总是:
ORANGE
RED
ORANGE
BLACK
RED
RED
BLUE BLACK
这总是输出,怎么可能是随机的???
【问题讨论】: