Skip to content

Commit d99b2e4

Browse files
committed
Added DICE.LUA xtra script
1 parent 6b848be commit d99b2e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

demo/xtra/DICE.LUA

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env lua
2+
3+
sides = tonumber(arg[2]) or 6 dice = tonumber(arg[1]) or 1 roll = {}
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

Comments
 (0)