Created
October 13, 2014 23:45
-
-
Save bodhi/4dce5682aa7da305e651 to your computer and use it in GitHub Desktop.
Dumb implementation of FizzBuzz
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
fizz = cycle [[], [], "fizz"] | |
buzz = cycle [[], [], [], [], "buzz"] | |
numbers = [1..] | |
fizzbuzz = zip3 fizz buzz numbers | |
toFizzBuzz [] [] x = show x | |
toFizzBuzz fizz buzz x = fizz ++ buzz | |
printTuple :: ([Char],[Char],Integer) -> IO () | |
printTuple (x,y,z) = print $ toFizzBuzz x y z | |
main = mapM_ printTuple $ take 100 fizzbuzz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment