📜  如何在 lua 代码示例中获取随机数

📅  最后修改于: 2022-03-11 14:54:53.947000             🧑  作者: Mango

代码示例1
local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.

print(randomNumber1, randomNumber2) --OUTPUT EXAMPLE: "6, 8"