Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Created April 16, 2011 05:27
Show Gist options
  • Save AlexBaranosky/922900 to your computer and use it in GitHub Desktop.
Save AlexBaranosky/922900 to your computer and use it in GitHub Desktop.
Clojure FizzBuzz from http://codingkata.org/katas/
(defn- fizz-buzz-step [n]
(let [fizzing? (= 0 (mod n 3))
buzzing? (= 0 (mod n 5))]
(if fizzing? (println "Fizz"))
(if buzzing? (println "Buzz"))
(if (not (or fizzing? buzzing?))
(println n))))
(defn fizz-buzz []
(doall (map fizz-buzz-step (range 0 100))))
(fizz-buzz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment