Skip to content

Instantly share code, notes, and snippets.

@sasaki-shigeo
Created August 27, 2013 08:52
Show Gist options
  • Save sasaki-shigeo/6351242 to your computer and use it in GitHub Desktop.
Save sasaki-shigeo/6351242 to your computer and use it in GitHub Desktop.
FizzBuzz in Haskell
-- FizzBuzz in Haskell
fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 3 == 0 = "Fizz"
| n `mod` 5 == 0 = "Buzz"
| otherwise = show n
main = do
putStr $ show $ map fizzBuzz [1..100]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment