Skip to content

Instantly share code, notes, and snippets.

@eribeiro
Last active December 19, 2015 15:49
Show Gist options
  • Save eribeiro/5979398 to your computer and use it in GitHub Desktop.
Save eribeiro/5979398 to your computer and use it in GitHub Desktop.
// scala
(1 to 100).toList foreach { x => x match {
case x if (x % 15 == 0) => println("FizzBuzz")
case x if (x % 3 == 0) => println("Fizz")
case x if (x % 5 == 0) => println("Buzz")
case x => println(x)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment