Lua乘法。始终从同一个操作开始

为什么总是从同一个操作开始?

function next_number()
 local a = math.random(1,9)
    local b = math.random(1,9)
    local result = tostring(a) .."*".. tostring(b)
    rightValue = a*b
    multiplication = result
end
点赞
用户107090
用户107090

你需要给随机数生成器设定一个种子。

在程序的开头调用 math.randomseed(os.time())

2018-05-23 22:05:38