Created
August 7, 2012 11:39
-
-
Save willnet/3284704 to your computer and use it in GitHub Desktop.
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
fizzbuzz :: Int -> String | |
fizzbuzz n | |
| n `mod` 15 == 0 = "fizzbuzz" | |
| n `mod` 3 == 0 = "fizz" | |
| n `mod` 5 == 0 = "buzz" | |
| otherwise = show n | |
main = do | |
mapM_ putStr $ map (++ ", ") (take 100 $ map fizzbuzz [1..]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment