Prog 3: Pentago

2/19/17 Added further point breakdown to specify that your program must check for a tie, in the situation where a rotation gives winning configurations for both players at the same time.  Shown in blue.

2/27/17 Added the naming convention if you are working with a partner, shown in red below.

Create the interface to allow two human players to play the game of Pentago.  This is played on a 6 x 6 board, where the objective is to be the first to get 5 in a row.  Instructions and sample play are shown below.

Running the program looks like:

Author: Dale Reed  Program: #3, Pentago  TA: Karla Templar, Tues 10  Feb 5, 2017   Play the two-player game of Pentago. Be the first to get 5 in a row.    Pentago is played on a 6 by 6 board, divided into four 3 by 3     quadrants.  There are two players, X and O, who alternate turns.  The goal of each player is to get five of their pieces in a row,  either horizontally, vertically, or diagonally.                      Players take turns placing one of their pieces into an empty      space anywhere on the board, then choosing one of the four        board quadrants to rotate 90 degrees left or right.                 If both players get five in a row at the same time, or the        last move is played with no five in a row, the game is a tie.     If a player makes five a row by placing a piece, there is no need to rotate a quadrant and the player wins immediately.               Play online at:  https://perfect-pentago.net                      Purchase at:     www.mindtwisterusa.com                             For each move provide four inputs:                                 row (A-F), column (1-6), quadrant (1-4), rotation direction (L or R)  For instance input of B32R places the next piece at B3 and then   would rotate quadrant 2 (upper-right) to the right (clockwise).      At any point enter 'x' to exit the program.                           1   1 2 3 4 5 6   2       -----------    A:  . . . . . .  :A    B:  . . . . . .  :B    C:  . . . . . .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    1. Enter row, column, quadrant, direction for X: c31r     1   1 2 3 4 5 6   2       -----------    A:  . . . . . .  :A    B:  . . . . . .  :B    C:  X . . . . .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    2. Enter row, column, quadrant, direction for O: A5 3R     1   1 2 3 4 5 6   2       -----------    A:  . . . . O .  :A    B:  . . . . . .  :B    C:  X . . . . .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    3. Enter row, column, quadrant, direction for X: A51R     *** That board location is already taken.  Please retry.  3. Enter row, column, quadrant, direction for X: G05h     *** Invalid move row.  Please retry.  3. Enter row, column, quadrant, direction for X: c05h     *** Invalid move column.  Please retry.  3. Enter row, column, quadrant, direction for X: c25h     *** Selected quadrant is invalid.  Please retry.   3. Enter row, column, quadrant, direction for X: c21h     *** Quadrant rotation direction is invalid.  Please retry.   3. Enter row, column, quadrant, direction for X: c2 1r     1   1 2 3 4 5 6   2       -----------    A:  X . . . O .  :A    B:  X . . . . .  :B    C:  . . . . . .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    4. Enter row, column, quadrant, direction for O: b 6 4 l     1   1 2 3 4 5 6   2       -----------    A:  X . . . O .  :A    B:  X . . . . O  :B    C:  . . . . . .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    5. Enter row, column, quadrant, direction for X: c53l     1   1 2 3 4 5 6   2       -----------    A:  X . . . O .  :A    B:  X . . . . O  :B    C:  . . . . X .  :C    D:  . . . . . .  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    6. Enter row, column, quadrant, direction for O: d6 3r     1   1 2 3 4 5 6   2       -----------    A:  X . . . O .  :A    B:  X . . . . O  :B    C:  . . . . X .  :C    D:  . . . . . O  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    7. Enter row, column, quadrant, direction for X: c41r     1   1 2 3 4 5 6   2       -----------    A:  . X X . O .  :A    B:  . . . . . O  :B    C:  . . . X X .  :C    D:  . . . . . O  :D    E:  . . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    8. Enter row, column, quadrant, direction for O: e14l     1   1 2 3 4 5 6   2       -----------    A:  . X X . O .  :A    B:  . . . . . O  :B    C:  . . . X X .  :C    D:  . . . O . .  :D    E:  O . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4    9. Enter row, column, quadrant, direction for X: c6 2r     1   1 2 3 4 5 6   2       -----------    A:  . X X X . .  :A    B:  . . . X . O  :B    C:  . . . X O .  :C    D:  . . . O . .  :D    E:  O . . . . .  :E    F:  . . . . . .  :F        -----------        3   1 2 3 4 5 6   4   10. Enter row, column, quadrant, direction for O: f2 3l O has won the game!      1   1 2 3 4 5 6   2       -----------    A:  . X X X . .  :A    B:  . . . X . O  :B    C:  . . . X O .  :C    D:  . . . O . .  :D    E:  . . O . . .  :E    F:  . O . . . .  :F        -----------        3   1 2 3 4 5 6   4   Thanks for playing.  Exiting... 

Notes & Recommended Steps

Your program must represent the board using an array, must do error checking on input as shown above and must detect when five in a row are detected.

(For those of you using Visual Studio, you may not submit code that includes scanf_s or #include stdafx.h which are Visual Studio-specific commands, and are not standard C.  Using these will result in a 15 point deduction, since we then have to manually edit your programs before we can test them.)

I suggest you write your program using the following steps for the 55 points for program execution:

Test Input

Submit your program