Created
February 25, 2012 00:38
-
-
Save ecounysis/1904920 to your computer and use it in GitHub Desktop.
Clojure Dice
This file contains hidden or 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
(defn make-die [sides] | |
(fn [] (+ 1 (rand-int sides)))) | |
(def d20 (make-die 20)) | |
(def d6 (make-die 6)) | |
(def d4 (make-die 4)) | |
(def d10 (make-die 10)) | |
(def d12 (make-die 12)) | |
(def d100 (make-die 100)) | |
(def d1000 (make-die 1000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment