We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9946ef3 commit 1f83210Copy full SHA for 1f83210
demo/xtra/DICE.LUA
@@ -1,5 +1,5 @@
1
#!/usr/bin/env lua
2
3
-sides = tonumber(arg[2]) or 6 dice = tonumber(arg[1]) or 1 roll = {}
+sides, dice, roll = tonumber(arg[2]) or 6, tonumber(arg[1]) or 1, {}
4
for _ = 1, dice do table.insert(roll, math.floor(math.random(1, sides))) end
5
print("Dice rolled: " .. table.concat(roll, ", "))
0 commit comments