Skip to content

Instantly share code, notes, and snippets.

@joshrotenberg
Created May 4, 2012 21:57
Show Gist options
  • Select an option

  • Save joshrotenberg/2597993 to your computer and use it in GitHub Desktop.

Select an option

Save joshrotenberg/2597993 to your computer and use it in GitHub Desktop.
fizzbuzz in clojure
(defn fizzbuzz
[]
(doseq [i (range 0 100)]
(cond
(and (= 0 (mod i 3)) (= 0 (mod i 5))) (prn "FizzBuzz")
(= 0 (mod i 3)) (prn "Fizz")
(= 0 (mod i 5)) (prn "Buzz")
:else (prn i))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment