Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

List the different categories of international employees. page 642

Answered: 1 week ago

Question

Explain the legal environments impact on labor relations. page 590

Answered: 1 week ago