Skip to content

Instantly share code, notes, and snippets.

View ghadishayban's full-sized avatar

Ghadi Shayban ghadishayban

View GitHub Profile
@ghadishayban
ghadishayban / Coder.scala
Created May 28, 2012 05:40 — forked from swannodette/Coder.scala
phone_code.clj
package demo
class Coder(words: List[String]) {
private val mnemonics = Map(
'2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
'6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ")
private val charCode: Map[Char, Char] =
for ((digit, str) <- mnemonics; letter <- str) yield letter -> digit