Last active
August 29, 2015 14:09
-
-
Save bbbates/05cb66644f59918a70d0 to your computer and use it in GitHub Desktop.
fizzbuzz - no conditionals
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 fizzbuzz | |
[n] | |
(let [r [(= 0 (mod n 3)) (= 0 (mod n 5))]] | |
(get {[true false] "fizz" [false true] "buzz" [true true] "fizzbuzz"} r n))) | |
(map fizzbuzz (range 1 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment