Skip to content

Instantly share code, notes, and snippets.

@moznion
Created July 29, 2012 12:44
Show Gist options
  • Save moznion/3198486 to your computer and use it in GitHub Desktop.
Save moznion/3198486 to your computer and use it in GitHub Desktop.
スタートHaskell 2 第2回目演習 FizzBuzz
fizzBuzz :: Int -> String
fizzBuzz x
| fizz && buzz = "FizzBuzz"
| fizz = "Fizz"
| buzz = "Buzz"
| otherwise = show x
where
fizz = x `mod` 3 == 0
buzz = x `mod` 5 == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment