[SOLVED] Game of Tic Tac Toe in CPP

12.00 $

Programming resource
, Digital learning resource
Categories: ,
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)
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.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.