You have a matrix of letters, like this, sort of like an on screen keyboard you'd use to login to Netflix on your TV
a b c d e f g h i j k l m n o p q r s t u v w x y z
And the task is to write some code that will take a word and calculate the "moves" required to spell the given word.
- the word is an argument
- the number of columns is configurable.
- A is the starting posision
- Two consecutive letters can just hit "enter/select" twice (see "output" section below)
- D for a down move
- U for an up move
- X for "enter/select"
Should be something like this
For example, spell "dog" using the matrix above
My solution is below