Matching on Value

val option = 2

option match {
    case 1: => "CNN"
    case 2: => "BBC"
    case _: => "Others"
}

Matching with guards

int_num match {
    case i if i%2 == 0 => "even"
    case i if i%2 == 1 => "odd"
    case _ => "Not an integer."
}