Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make Tac Toe, Instead of using Xs and Os, use colors. The image shows the same g

ID: 3531570 • Letter: M

Question


Make Tac Toe, Instead of using Xs and Os, use colors. The image shows the same games as above, using Red (R) for unplayed squares, Green (G) for one player which was O above and Blue (B) for the other player In this assignment you will design and create an object-oriented Tic Tac Toe program which uses CImg to display the gameboard. The design of the class for the TicTacToe game must have good object oriented features including: Member variables: This class must store the gameboard in a two-dimensional array of a base type which makes sense. Member functions: There must be at least one constructor and at least two other member functions that manipulate the multidimensional array. Specify preconditions and postconditions for each function in header file. Handle cases so that the users cannot choose positions that have already been selected or that do not exist. Use the CImg header library to show the state of the gameboard after each play. The program should alternately request moves from each player as long as there are spots left on the gameboard. The program should be able to terminate if there is a winner or there are no more places to play and a draw has occurred. To communicate with the user about the gameboard, have the user enter the actual row' number and the column number as follows: Finally, your program should recognize when either one of the two players has won or when there are no additional possible moves and the game ends with a tie. In each case, the program should respond accordingly. This program must use a class that stores a two-dimensional array for the game board and provides the member functions to enable the user to play the game.

Explanation / Answer

Here is a tic tac toe code you can take inspiration from


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote