Last active
August 29, 2015 14:10
-
-
Save trikitrok/d88f430816823b1375cf 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
(def naturals (drop 1 (range))) | |
(def fizz-buzz-seq | |
(map #(clojure.string/replace (str %1 %2) #"^$" (str %3)) | |
(cycle '("" "" "Fizz")) | |
(cycle '("" "" "" "" "Buzz")) | |
naturals)) | |
(defn fizz-buzz [n] | |
(clojure.string/join " " (take n fizz-buzz-seq))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment