Skip to content

Instantly share code, notes, and snippets.

@jacobwalkr
Last active August 29, 2015 14:07
Show Gist options
  • Save jacobwalkr/b514a15611ee5e964e6b to your computer and use it in GitHub Desktop.
Save jacobwalkr/b514a15611ee5e964e6b to your computer and use it in GitHub Desktop.
Start of Fizzbuzz in Haskell
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