Created
August 31, 2010 16:50
-
-
Save mmisono/559326 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
main = do putStr $ unlines $ map fizzbuzz [1..100] | |
fizzbuzz :: Int -> String | |
fizzbuzz x | x `mod` 15 == 0 = "FizzBuzz" | |
| x `mod` 5 == 0 = "Buzz" | |
| x `mod` 3 == 0 = "Fizz" | |
| otherwise = show x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment