Created
September 20, 2021 17:21
-
-
Save Crowbrammer/63834dc01e5a92b97e0be9128a701281 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
(defn fizzbuzz | |
"If div by 3, fizz; if by div by 5, buzz; | |
if div by both, fizzbuzz" | |
[num] | |
(if (zero? (mod num 3)) | |
(if (zero? (mod num 5)) | |
"fizzbuzz" | |
"fizz") | |
(when (zero? (mod num 5)) | |
"buzz"))) | |
(map #(println % ":"(fizzbuzz %)) (range 50)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment