Last active
August 29, 2015 14:07
-
-
Save jacobwalkr/b514a15611ee5e964e6b to your computer and use it in GitHub Desktop.
Start of Fizzbuzz in Haskell
This file contains 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
noRem :: Int -> Int -> Bool | |
noRem x y = (rem x y) == 0 | |
fizzbuzz :: Int -> String | |
fizzbuzz x | |
| noRem x 15 = "fizzbuzz" | |
| noRem x 3 = "fizz" | |
| noRem x 5 = "buzz" | |
| otherwise = show x | |
main = putStrLn $ unlines [ fizzbuzz x | x <- [1..100] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment