Skip to content

Instantly share code, notes, and snippets.

@taylorleese
Created March 19, 2011 23:51
Show Gist options
  • Save taylorleese/877919 to your computer and use it in GitHub Desktop.
Save taylorleese/877919 to your computer and use it in GitHub Desktop.
Scala FizzBuzz.
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