Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created March 22, 2012 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/2159796 to your computer and use it in GitHub Desktop.
Save swannodette/2159796 to your computer and use it in GitHub Desktop.
(defn matchtostring [n]
(let [mod3 (mod n 3)
mod5 (mod n 5)]
(cond
(and (zero? mod3) (zero? mod5)) "fizzbuzz"
(zero? mod3) "fizz"
(zero? mod5) "buzz"
:else n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment