Created
December 18, 2015 12:27
-
-
Save bas080/7307003a6247ae9c6352 to your computer and use it in GitHub Desktop.
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
(defn throw-die [] (inc (rand-int 6))) | |
(defn throw-dice [] (repeatedly throw-die)) | |
(defn yahtzee? [numbers] (apply = numbers)) | |
(defn printlnrt [v] (do (println v) v)) | |
(defn throw-yahtzee [] (while (not (yahtzee? (printlnrt (take 14 (throw-dice))))))) | |
(throw-yahtzee) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment