Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. -- Fizzbuzzing
  2. fizzBuzz True False _ = "Fizz"
  3. fizzBuzz False True _ = "Buzz"
  4. fizzBuzz True True _ = "FizzBuzz"
  5. fizzBuzz _ _ x = show x
  6.  
  7. main = do
  8. mapM_ putStrLn [fizzBuzz (three x) (five x) x | x <- [1..100]]
  9. where
  10. three n = n `mod` 3 == 0
  11. five n = n `mod` 5 == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement