Last active
December 17, 2015 22:48
-
-
Save kagamilove0707/5684245 to your computer and use it in GitHub Desktop.
Clojureで書いたFizzBuzzですー>ω<
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 [n] (let [fizz (zero? (mod n 3)) | |
buzz (zero? (mod n 5))] (cond | |
(and fizz buzz) 'FizzBuzz | |
fizz 'Fizz | |
buzz 'Buzz | |
:else (str n)))) | |
(println (clojure.string/join "\n" (map fizzbuzz (range 1 101)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment