Skip to content

Instantly share code, notes, and snippets.

@marionette-of-u
Created August 18, 2012 21:41
Show Gist options
  • Save marionette-of-u/3390045 to your computer and use it in GitHub Desktop.
Save marionette-of-u/3390045 to your computer and use it in GitHub Desktop.
(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