Skip to content

Commit 532d6c2

Browse files
committed
Added comments and nicer formatting of Lua scripts in the 'xtra' directory.
1 parent 4c89836 commit 532d6c2

File tree

7 files changed

+927
-169
lines changed

7 files changed

+927
-169
lines changed

xtra/DICE.LUA

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

3+
-- sides = The amount of sides a dice has
4+
-- dice = The amount of dice to roll
5+
-- roll = The amount of times to roll the dice
36
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
7+
for _ = 1, dice do
8+
table.insert(roll, math.floor(math.random(1, sides)))
9+
end
510
print("Dice rolled: " .. table.concat(roll, ", "))

0 commit comments

Comments
 (0)