Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Fizzbuzzing
- fizzBuzz True False _ = "Fizz"
- fizzBuzz False True _ = "Buzz"
- fizzBuzz True True _ = "FizzBuzz"
- fizzBuzz _ _ x = show x
- main = do
- mapM_ putStrLn [fizzBuzz (three x) (five x) x | x <- [1..100]]
- where
- three n = n `mod` 3 == 0
- five n = n `mod` 5 == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement