Created
July 25, 2015 03:20
-
-
Save emdeesee/d90e0e585bbec05b674d to your computer and use it in GitHub Desktop.
FizzBuzz vs. Clojure, round 2
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
;; less code golf, more readability | |
;; also complies with specs of the problem by sending results to stdout (rather than just generating a sequence) | |
(doseq [n (map (some-fn #(and (= (mod % 3) 0) (= (mod % 5) 0) "FizzBuzz") | |
#(and (= (mod % 3) 0) "Fizz") | |
#(and (= (mod % 5) 0) "Buzz") | |
identity) (range 1 101))] | |
(println n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment