Skip to content

Instantly share code, notes, and snippets.

@PhDP
Created June 28, 2013 17:50
Show Gist options
  • Save PhDP/5886622 to your computer and use it in GitHub Desktop.
Save PhDP/5886622 to your computer and use it in GitHub Desktop.
fizzbuzz
fizzbuzz a b x = [fb i | i <- [1..x]]
where
ab = a * b
fb n
| mod n ab == 0 = "FizzBuzz"
| mod n a == 0 = "Fizz"
| mod n b == 0 = "Buzz"
| otherwise = show n
main = mapM_ print $ fizzbuzz 5 7 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment