Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 8, 2015 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/5ff0021e42855e0ee841 to your computer and use it in GitHub Desktop.
Save shigemk2/5ff0021e42855e0ee841 to your computer and use it in GitHub Desktop.
val someNumber = 5
val evenOrOdd = someNumber match {
case 1 | 3 | 5 | 7 | 9 => println("odd")
case 2 | 4 | 6 | 8 | 10 => println("even")
}
println(evenOrOdd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment