Created
March 13, 2012 17:00
-
-
Save MachinesAreUs/2029919 to your computer and use it in GitHub Desktop.
FizzBuzz en haskell
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 x | |
| x `mod` 3 == 0 && x `mod` 5 == 0 = "fizzbuzz" | |
| x `mod` 3 == 0 = "fizz" | |
| x `mod` 5 == 0 = "buzz" | |
| otherwise = show x | |
fizzbuzz100 = | |
mapM_ putStrLn [ fizzbuzz x | x <- [1..100] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment