Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foobuzz n = f (n `mod` 3 == 0) (n `mod` 5 == 0)
- where
- f True True = "foobuzz"
- f True _ = "foo"
- f _ True = "buzz"
- f _ _ = ""
- foobuzz_if n = if n `mod` 15 == 0 then "foobuzz" else if n `mod` 5 == 0 then "buzz" else if n `mod` 3 == 0 then "foo" else ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement