Skip to content

Instantly share code, notes, and snippets.

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