Skip to content

Instantly share code, notes, and snippets.

@zonoise
Created March 11, 2012 21:15
Show Gist options
  • Save zonoise/2018231 to your computer and use it in GitHub Desktop.
Save zonoise/2018231 to your computer and use it in GitHub Desktop.
Haskell FizzBuzz
fizzBuzz :: Int -> String
fizzBuzz a
| 0 == (mod a 3) && 0 == (mod a 5) = "FizzBuzz"
| 0 == (mod a 3) = "Fizz"
| 0 == (mod a 5) = "Buzz"
| otherwise = show a
main = putStrLn(show(map fizzBuzz [1..100]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment