Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Telephone Words

0 views
Skip to first unread message

Ken Elpus

unread,
Jan 29, 1995, 3:38:32 PM1/29/95
to

Does anyone have the code to a program that will translate a phone number
into the corresponding words formed by all the combinations of letters
and vice versa?

For instance, translate FOO-BARR into words, and 908-5656 into all the
possible letter combinations.

If not, how would I go about programming a program like this?

aTdHvAaNnKcSe (Thanks in advance)

Ken..

bsc...@vms.cis.pitt.edu

unread,
Jan 29, 1995, 10:11:52 PM1/29/95
to

I'm not sure I understand what you mean by "translate FOO-BARR into
words". If you mean "translate into numbers", the problem is fairly
simple, as one can easily write a function that maps letters into digits
(though one has to be careful to handle the "illegal" values, such as "Q",
correctly).

As for writing out all the word possibilities for 7-digit phone
numbers, this is equivalent to counting in ternary up to 7 digits, or 3**7
possible numbers (that's 2187 "words", if the non-Intel processor in my
head is doing its arithmetic correctly ...). [Oops -- forgot myself about
the possible "illegal" numbers, like 1 and 0 ...].

Bob Schor
Pascal Enthusiast

0 new messages