我的问题是,当我写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'
Run Code Online (Sandbox Code Playgroud)
输出总是:
ORANGE
RED
ORANGE
BLACK
RED
RED
BLUE BLACK
Run Code Online (Sandbox Code Playgroud)
这总是输出,怎么可能是随机的????