/PhoneMnemonics

Solved using higher-order functions without explicit recursion

Primary LanguageScala

Phone Mnemonics Problem

Scala's founder, Martin Odersky, uses this problem to show off the power of Scala and functional programming paradigm.

Given a phone number, what is the word sequence spelled on the touch-tone pad?

Example:

  • For 435 569 6753, return "hello world" among other sequences.
  • For 7225247386, return "scala is fun" among others.

Implementation

This implementation slightly differs from Martin Odersky's solution. No recursion, only higher-order functions! (map, flatMap, reduce)

Credits

This small project is part of the course on Programming Paradigms taught by Cay Horstmann at SJSU.