Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FizzBuzz
fizzBuzz max = [fizzBuzzConvert x | x <- [1..max]]
fizzBuzzConvert x
| x `mod` 15 == 0 = "FizzBuzz"
| x `mod` 3 == 0 = "Fizz"
| x `mod` 5 == 0 = "Buzz"
| otherwise = show x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment