Created
March 10, 2020 08:03
-
-
Save spasiu/88faff4621ea4ddca5f4442020ebd462 to your computer and use it in GitHub Desktop.
fizzbuzz
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
| (ns learnclojure.fizzbuzz) | |
| (defn fun [x] | |
| (if | |
| (and (= (mod x 3) 0) (= (mod x 5) 0)) | |
| "fizzbuzz" | |
| (if | |
| (= (mod x 3) 0) | |
| "fizz" | |
| (if | |
| (= (mod x 5) 0) | |
| "buzz" | |
| (str x))))) | |
| (doseq [x (map fun (range 1 101))] (println x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment