Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- factOf :: Int -> Int -> Bool
- factOf n n' = n `rem` n' == 0
- fizzBuzz :: [Int] -> String
- fizzBuzz = concatMap (\n -> (fBHelp n) ++ "\n")
- where fBHelp n
- | n `factOf` 3 && n `factOf` 5 = "FizzBuzz"
- | n `factOf` 3 = "Fizz"
- | n `factOf` 5 = "Buzz"
- | otherwise = show n
- main = putStrLn (fizzBuzz [0..100])
Advertisement
Add Comment
Please, Sign In to add comment