Skip to content

Instantly share code, notes, and snippets.

@emdeesee
Created July 25, 2015 03:20
Show Gist options
  • Save emdeesee/d90e0e585bbec05b674d to your computer and use it in GitHub Desktop.
Save emdeesee/d90e0e585bbec05b674d to your computer and use it in GitHub Desktop.
FizzBuzz vs. Clojure, round 2
;; 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