Created
October 5, 2009 20:16
-
-
Save anonymous/202421 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 fizzbuzz | |
[from to] | |
(map | |
#(let [ fb [(zero? (mod % 3)) (zero? (mod % 5))]] | |
(condp = fb | |
[true true] "FizzBuzz" | |
[true false] "Fizz" | |
[false true] "Buzz" | |
%)) | |
(range from to))) | |
(println (fizzbuzz 1 101)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment