Skip to content

Instantly share code, notes, and snippets.

@shayelkin
Last active December 17, 2015 09:09
Show Gist options
  • Save shayelkin/5585299 to your computer and use it in GitHub Desktop.
Save shayelkin/5585299 to your computer and use it in GitHub Desktop.
Inspiration for fizzbuzz.py
c i s = take i (repeat "") ++ [s]
fb = zipWith (++) (cycle (c 2 "Fizz")) (cycle (c 4 "Buzz"))
fizzbuzz = zipWith (\x y -> if null x then show y else x) fb [1..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment