Reference no: EM132152187
Tic-Tac-Toe, also called X's and O's, Noughts and Crosses, and X and 0 is a simple game played on a 3x3 grid, referred to as the board. Lines may be horizontal, vertical, or diagonal.
You will implement a Board class to represent the 3x3 grid. This class will have functions to determine which symbol, if any, is in a cell, to place a symbol in a cell, to determine the winner, if any so far, and to print the board to standard output. The board should appear as below:
Implement a Board class with the following functionality:
Default constructor, copy constructor, destructor, assignment operator.
Determine the symbol at the specified grid position.
Change the symbol at the specified grid position.
Determine the winner of the game, if any. You must distinguish between the case where there is no winner because the game is not over yet, and the case where there is no winner because the game ended in a tie.
Create four constants for the four game states and return one of them.
Find a way to pass the position in the grid as a single value. This can be done by creating a record (struct) to store the row and column, or by representing both values using a single integer.
Print the board to standard output.