Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:3615319
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
val tiles = Map[Char, Int](
'a' -> 1,
'b' -> 3,
'c' -> 3,
'd' -> 2
// etc.
)
 
def main(args: Array[String]) {
var out = Vector[String]()
out ++= Seq(
"",
"Scrabble Calculator 1.0",
"Enter words on the commandline.",
"Use a '_' character for blank tiles.",
""
)
out ++= args map {
case w if w.length < 2 => w + ": one-letter words disallowed in Scrabble"
case w => w + ": " + (w map tiles).sum + " points"
}
out foreach println
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.