Skip to content

Instantly share code, notes, and snippets.

@btholt
Created July 29, 2014 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btholt/bb2ec16241f5d3c4c49c to your computer and use it in GitHub Desktop.
Save btholt/bb2ec16241f5d3c4c49c to your computer and use it in GitHub Desktop.
Haskell FizzBuzz
fizzWord :: Integer -> String
fizzWord x
| x `mod` 15 == 0 = "fizzbuzz"
| x `mod` 3 == 0 = "fizz"
| x `mod` 5 == 0 = "buzz"
| otherwise = show x
fizzBuzz max = map fizzWord [1..max]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment