Created
November 16, 2021 16:48
-
-
Save classmember/b3524988595146e0bacf3bbe7c019540 to your computer and use it in GitHub Desktop.
rolls a 20 sided dice in Clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; roll-20-sided-dice.clj | |
;; return a function that rolls a 20 sided dice | |
(def roll-20-sided-dice | |
(fn [] (inc (int (rand 19))))) | |
;; call function to roll 20 sided dice | |
(roll-20-sided-dice) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment