Prog 5: AcrossWords

Create the game of AcrossWords, where a 4x4 grid of letters contains four four-letter words that have been scrambled.  You have to unscramble them.  

Note that while you could work with a partner on programs 3 and 4, you must work on this program (5) and the next program (6) on your own.

4/4 Updates below shown in blue, clarifying what the extra credit does and what the 'u' (for unveil) option does. Program output was made consistent, removing the references to a timer, which is not used in this program.  A clarifying statement was made for the step describing reading in input from the dictionaries.

4/11 Clarification of the extra credit shown in green.

4/14 Comment added before steps 3 & 4: Steps 3 & 4 below are intermediate steps in your program development process, to help you get to step 5.

Running Your Program

Running the program looks like the following:

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 unveil the underlying words.           Enter 's' to auto solve the board (Extra Credit)            Enter 'x' to exit the program.                            Which dictionary size do you want? (1=small, 2=medium, 3=large): 1 There are 500 4-letter words.        E F G H      -------   A| e u s h   B| t n e w   C| b l i v   D| o k k o 1. Enter the row or column to be rotated, and a number 1..3: d2       E F G H      -------   A| e u s h   B| t n e w   C| b l i v   D| k o o k 2. Enter the row or column to be rotated, and a number 1..3: e2       E F G H      -------   A| b u s h   B| k n e w   C| e l i v   D| t o o k 3. Enter the row or column to be rotated, and a number 1..3: c3       E F G H      -------   A| b u s h   B| k n e w   C| l i v e   D| t o o k Congratulations! You solved it!  End of program.  Exiting...

Running the program a different time, with a larger (medium) dictionary could give you:

Author: Dale Reed           Program: #5, AcrossWords    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 unveil the underlying words.           Enter 's' to auto solve the board (Extra Credit)            Enter 'x' to exit the program.                            Which dictionary size do you want? (1=small, 2=medium, 3=large): 2 There are 2404 4-letter words.        E F G H      -------   A| d u t l    B| s g e e    C| s i r o    D| o u z y  1. Enter the row or column to be rotated, and a number 1..3: h1       E F G H      -------   A| d u t y    B| s g e l    C| s i r e    D| o u z o  2. Enter the row or column to be rotated, and a number 1..3: u You chose 'u' to unveil.  Here are the underlying words:        E F G H      -------   A| d u t y    B| g e l s    C| i r e s    D| o u z o         E F G H      -------   A| d u t y    B| s g e l    C| s i r e    D| o u z o  2. Enter the row or column to be rotated, and a number 1..3: r You chose 'r' to reset the board.  Enter 16 char values to reset the board: eushtnewblivo    Sorry, needed to provide exactly 16 characters of user input to reset the board.  Please retry. Enter 16 char values to reset the board: eushtnewblivokko       E F G H      -------   A| e u s h    B| t n e w    C| b l i v    D| o k k o  2. Enter the row or column to be rotated, and a number 1..3: x You chose x to Exit...

What to Do

You will write the program in steps.  To get credit you must finish each step before you go on to the next.  The outline of the steps and the number of points are given here, but details for each step then follow below.

Details on What to Do

Notes:

Submitting your Program