Skip to content

Commit 1f83210

Browse files
committed
Refactor variable initialization in DICE.LUA.
1 parent 9946ef3 commit 1f83210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demo/xtra/DICE.LUA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env lua
22

3-
sides = tonumber(arg[2]) or 6 dice = tonumber(arg[1]) or 1 roll = {}
3+
sides, dice, roll = tonumber(arg[2]) or 6, tonumber(arg[1]) or 1, {}
44
for _ = 1, dice do table.insert(roll, math.floor(math.random(1, sides))) end
55
print("Dice rolled: " .. table.concat(roll, ", "))

0 commit comments

Comments
 (0)