Last active
August 29, 2015 14:11
-
-
Save taylorlapeyre/dd53b80ee7760cc9b619 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 divisible? | |
| "Returns true if the remainder of x / y is zero, else false." | |
| [x y] | |
| (zero? (rem x y))) | |
| (defn fizzbuzz | |
| "Returns Fizz if n is divisible by 3, buzz if n is divisible by 5, | |
| and fizzbuzz if n is divisible by both." | |
| [n] | |
| (cond (divisible? n 15) "fizzbuzz" | |
| (divisible? n 3) "fizz" | |
| (divisible? n 5) "buzz" | |
| :else n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment