Last active
October 30, 2018 23:24
-
-
Save mbloms/f79634491c770f2cef837b041199616a 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
import Data.List (cycle, zipWith3) | |
fizz = cycle $ [False,False,True] | |
buzz = cycle $ [False,False,False,False,True] | |
fizzbuzz False False i = show i | |
fizzbuzz True False _ = "Fizz" | |
fizzbuzz False True _ = "Buzz" | |
fizzbuzz True True _ = "FizzBuzz" | |
main = mapM_ putStrLn $ zipWith3 fizzbuzz fizz buzz [1..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment