Last active
January 2, 2016 07:09
-
-
Save mnzk/8268456 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
;; hy-lang fizzbuzz | |
(import [itertools [count imap]]) | |
(import [pprint [pprint]]) | |
(defn freq [v n] | |
(->> (* [""] (dec n)) (+ [v]))) | |
(defn fizzbuzz [] | |
(->> (imap (fn [f b n] (or (+ f b) n)) | |
(cycle (freq "fizz" 3)) | |
(cycle (freq "buzz" 5)) | |
(count)) | |
(drop 1))) | |
(pprint (->> (fizzbuzz) (take 100) list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment