The Chairman is very fond of puzzles, ciphers and secret codes. All of which lend themselves to PowerShell. Today’s Intermediate level challenge falls into this category. Although some of the bonus elements might require a bit more skill.
When you look at a telephone keypad, you will see that there is an alphabetic layout with each digit. There may be cultural distinctions, but The Chairman is hoping not enough to prevent you from participating in this challenge. Using the alphabet layout on phone, write a PowerShell function to convert a simple word to its numeric equivalent. For example, on a US phone, ‘help’ can be converted to 4357.
The lazy and easy way, would be to do a 1-1 substitution between alphabet characters and numbers. But Iron Scripters are made of stronger metal. Since the letters are grouped by number, let that be your guide.
- Limit word length to 5 word characters.
- Write a function to convert the numeric “word” back into plain text.