You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
264 B

;; dice-roller.fnl
(math.randomseed (os.time))
(fn roll []
"Return a random number between 1 and 6"
(math.random 1 6)
)
(fn rolls []
"Return a table of 3 random numbers"
(local t [])
(for [i 1 3]
(table.insert t (roll))
)
t
)
{: rolls }