Created
March 19, 2011 23:51
-
-
Save taylorleese/877919 to your computer and use it in GitHub Desktop.
Scala FizzBuzz.
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
object FizzBuzz { | |
def main(args: Array[String]) { | |
for (i <- 1 to 100) { | |
(i % 3, i % 5) match { | |
case (0, 0) => println("FizzBuzz") | |
case (0, _) => println("Fizz") | |
case (_, 0) => println("Buzz") | |
case _ => println(i) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment