Question
// Please use c++ Game of Tic Tac Toe Use a 2-D char array with 3 rows and 3 columns as the game board. Each
// Please use c++
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started