Question: Using C++ to program an tic tac toe game Must Use both Class and Enum class methods You must create a class for the board.

Using C++ to program an tic tac toe game Must Use both Class and Enum class methods

You must create a class for the board. Suggested member functions include:

creating an empty board (which is called by the constructor)

printing the board

checking whether a move is valid

applying a move to the board

checking whether a player won

You must create an enum class to represent the state of the elements in the board. The reasonable states are empty, an X, and an O.

Other suggested functions include:

Reading a move from the user including validation.

A game loop that

Reads and validates a move from the current player

Update the board state

Print the board

Check if the game is over and print a win message if so

Repeat until the game is over

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!