Last active
June 30, 2017 08:10
-
-
Save otofu-square/b24d6f7edf812410becd39831c2d1979 to your computer and use it in GitHub Desktop.
Fizzbuzz in clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fizzbuzz | |
[n] | |
(cond | |
(and (= (rem n 3) 0) (= (rem n 5) 0)) "fizzbuzz" | |
(= (rem n 5) 0) "buzz" | |
(= (rem n 3) 0) "fizz" | |
:else (.toString n))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment