Created
January 31, 2013 17:06
-
-
Save MichaelDrogalis/4684403 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
user> (def fiz (take 15 (cycle [nil nil "Fiz"]))) | |
#'user/fiz | |
user> (def buzz (take 15 (cycle [nil nil nil nil "Buzz"]))) | |
#'user/buzz | |
user> (map (partial apply str) (map list fiz buzz)) | |
("" "" "Fiz" "" "Buzz" "Fiz" "" "" "Fiz" "Buzz" "" "Fiz" "" "" "FizBuzz") |
Better to put the (take 15)
around the final map, that way you're not limiting yourself until the very end. Trust in the lazy sequence!
@mediocregopher Woooo!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THIS IS CHEATING
Real FizBuzz involves modulus math, would not hire F--