Note that there are some explanatory texts on larger screens.

plurals
  1. POCode Golf: Phone Number to Words
    text
    copied!<p><a href="https://meta.stackexchange.com/questions/24242">Guidelines for code-golf on SO</a></p> <p>We've all seen phone numbers that are put into words: 1-800-BUY-MORE, etc. </p> <p>What is the shortest amount of code you can write that will produce all the possible combinations of words for a 7 digit US phone number. </p> <p>Input will be a seven-digit integer (or string, if that is simpler), and assume that the input is properly formed. </p> <p>Output will be a list of seven-character strings that </p> <p>For instance, the number 428-5246 would produce</p> <p>GATJAGM<br> GATJAGN<br> GATJAGO<br> GATJAHM<br> GATJAHN<br> GATJAGO<br> GATJAIM<br> GATJAIN<br> GATJAIO and so on..... </p> <p>Winning criterion will be code from any language with the fewest characters that produces every possible letter combination. </p> <p>Additional Notes:</p> <ul> <li>To make it more interesting, words can be formed only by using the letters on a <strong>North American Classic Key Pad</strong> phone with three letters per number <a href="http://www.dialabc.com/motion/keypads.html" rel="nofollow noreferrer">as defined here</a>.<strong><em>That means that Z and Q are excluded.</em></strong> </li> <li>For the number '1', put a space.</li> <li>For the number '0', put a hyphen '-'</li> </ul> <p>Bonus points awarded for recognizing output as real English words. Okay, not really. ;-)</p> <p><strong>Added:</strong> Okay, lets go with "Nick's Modified North American Classic Key Pad" which has an 'O' (oh, not zero) on the 6 key.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload