Prog 6: Across Undo

This program is the same as the previous one, except we always use the small dictionary and allow undoing moves.  Attempting to undo a move at the beginning of the game gives a warning message and allows the user to retry.  Running the program looks something like the following:

Author: Dale Reed           Program: #6, AcrossWords with Undo    TA: Claude Shannon, Th 4-5  Mar 30, 2017                 Welcome to AcrossWord puzzle, where you rotate rows or columns        to restore the board back to containing four words. Each move is      a row or column letter followed by the rotation distance 1,2 or 3.    When prompted to provide input you may enter:                    Enter 'r' to reset the board to user-defined values.        Enter 'u' to undo a move.                                   Enter 'o' for original board to be shown                    Enter 'x' to exit the program.                            There are 500 4-letter words.        E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t     List: 1 1. Enter the row or column to be rotated, and a number 1..3: o You chose 'o' for the original board to be shown.  Here are the underlying words:        E F G H      -------   A| t i l l    B| h o s t    C| t e a m    D| s e l f         E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t  1. Enter the row or column to be rotated, and a number 1..3: d1       E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| t s e l     List: 2->1 2. Enter the row or column to be rotated, and a number 1..3: h1       E F G H      -------   A| t i l l    B| f h o m    C| l t e s    D| t s e a     List: 3->2->1 3. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to undo the most recent move.  * Undoing move *        E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| t s e l     List: 2->1 2. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to undo the most recent move.  * Undoing move *        E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t     List: 1 1. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to undo the most recent move.  *** You cannot undo past the beginning of the game.  Please retry.       E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t     List: 1 1. Enter the row or column to be rotated, and a number 1..3: c3       E F G H      -------   A| t i l m    B| f h o s    C| t e a l    D| s e l t     List: 2->1 2. Enter the row or column to be rotated, and a number 1..3: h2       E F G H      -------   A| t i l l    B| f h o t    C| t e a m    D| s e l s     List: 3->2->1 3. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to undo the most recent move.  * Undoing move *        E F G H      -------   A| t i l m    B| f h o s    C| t e a l    D| s e l t     List: 2->1 2. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to undo the most recent move.  * Undoing move *        E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t     List: 1 1. Enter the row or column to be rotated, and a number 1..3: o You chose 'o' for the original board to be shown.  Here are the underlying words:        E F G H      -------   A| t i l l    B| h o s t    C| t e a m    D| s e l f         E F G H      -------   A| t i l m    B| f h o s    C| l t e a    D| s e l t  1. Enter the row or column to be rotated, and a number 1..3: b3       E F G H      -------   A| t i l m    B| h o s f    C| l t e a    D| s e l t     List: 2->1 2. Enter the row or column to be rotated, and a number 1..3: c3       E F G H      -------   A| t i l m    B| h o s f    C| t e a l    D| s e l t     List: 3->2->1 3. Enter the row or column to be rotated, and a number 1..3: h2       E F G H      -------   A| t i l l    B| h o s t    C| t e a m    D| s e l f     List: 4->3->2->1 Congratulations!  You solved it!

Notes:

Steps to Take:

Submitting your Program