Created
October 25, 2016 13:05
-
-
Save dannycjones/aef3cae8c3aa5128142117fda2319f39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fizzBuzz :: [Int] -> [String] | |
fizzBuzz listOfNumbers = [fizzify x | x <- listOfNumbers] | |
where | |
fizzify :: Int -> String | |
fizzify num | |
| fizz && buzz = "FizzBuzz" | |
| fizz = "Fizz" | |
| buzz = "Buzz" | |
| otherwise = show num | |
where fizz = num `mod` 3 == 0 | |
buzz = num `mod` 5 == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment