Created
August 18, 2012 21:41
-
-
Save marionette-of-u/3390045 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
(ns org.program.main) | |
(defn fizzbuzz [curr n] | |
(if (= curr n) | |
'("end...") | |
(if (= 0 (mod curr 15)) | |
(cons "fizzbuzz" (fizzbuzz (inc curr) n)) | |
(if (= 0 (mod curr 5)) | |
(cons "buzz" (fizzbuzz (inc curr) n)) | |
(if (= 0 (mod curr 3)) | |
(cons "fizz" (fizzbuzz (inc curr) n)) | |
(cons (format "%s" curr) (fizzbuzz (inc curr) n))))))) | |
(defn -main [n] | |
(fizzbuzz 1 n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment