Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created July 20, 2015 04:03
Show Gist options
  • Select an option

  • Save shigemk2/123c8509a592fb34edd5 to your computer and use it in GitHub Desktop.

Select an option

Save shigemk2/123c8509a592fb34edd5 to your computer and use it in GitHub Desktop.
def pnPrime(str: String): Double = str.split(" ").toList match {
case (x::y::zs) if x == "+" => y.toDouble + zs.head.toDouble
}
println(pnPrime("+ 1 2"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment