Skip to content

Instantly share code, notes, and snippets.

@willnet
Created August 7, 2012 11:39
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 willnet/3284704 to your computer and use it in GitHub Desktop.
Save willnet/3284704 to your computer and use it in GitHub Desktop.
fizzbuzz
fizzbuzz :: Int -> String
fizzbuzz n
| n `mod` 15 == 0 = "fizzbuzz"
| n `mod` 3 == 0 = "fizz"
| n `mod` 5 == 0 = "buzz"
| otherwise = show n
main = do
mapM_ putStr $ map (++ ", ") (take 100 $ map fizzbuzz [1..])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment