Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created January 31, 2013 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MichaelDrogalis/4684403 to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/4684403 to your computer and use it in GitHub Desktop.
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")
@owengalenjones
Copy link

THIS IS CHEATING

Real FizBuzz involves modulus math, would not hire F--

@mediocregopher
Copy link

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!

https://gist.github.com/mediocregopher/6993492

@MichaelDrogalis
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment