Created
May 12, 2013 05:15
-
-
Save cacoco/5562510 to your computer and use it in GitHub Desktop.
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
(ns fizzbuzz.core) | |
(defn multiple? [x n] | |
(= 0 (mod x n))) | |
(defn fizzbuzz [number] | |
(if (multiple? number 3) | |
(if (multiple? number 5) (prn "FizzBuzz") (prn "Fizz")) | |
(if (multiple? number 5) (prn "Buzz") (prn number)))) | |
(defn -main [& _] | |
(loop [i 1] | |
(when (< i 101) | |
(fizzbuzz i) | |
(recur (inc i))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment