Starting from:

$10

Game of Tic Tac Toe in CPP

Game of Tic Tac Toe Use a 2-D char array with 3 rows and 3 columns as the game board.

Each element in the array should be initialized with an asterix (*).

The program should contain a loop that

1) Displays the contents of the board array.

2) Allows player 1 to select a location on the board for an X, the program should ask the user for the row and col number. Validate the row and column entered.

3) Allows player 2 to select a location on the board for an O. The program should ask the user for the row and col number. Validate the row and column entered.

4) Determine whether a player has won, or a tie has occurred. If the player has won, the program should declare the player the winner and end. If a tie has occurred the program should say so and end. Player 1 wins if there are 3 X's on the board and they are in a row, either in a col, row, or diagonally. A tie occurs when all locations on the board are full, but there is no winner.

More products