Skip to content

Instantly share code, notes, and snippets.

@marionette-of-u
Created August 18, 2012 21:58
Show Gist options
  • Save marionette-of-u/3390096 to your computer and use it in GitHub Desktop.
Save marionette-of-u/3390096 to your computer and use it in GitHub Desktop.
(ns org.program.main)
(defn fizzbuzz [curr n]
(cond
(= curr n) '("end...")
(= 0 (mod curr 15)) (cons "fizzbuzz" (fizzbuzz (inc curr) n))
(= 0 (mod curr 5)) (cons "buzz" (fizzbuzz (inc curr) n))
(= 0 (mod curr 3)) (cons "fizz" (fizzbuzz (inc curr) n))
:else (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