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

(Using OPENGL - simple graphics - C++) OBJECT ORIENTED PROGRAMMING 1. The task f

ID: 3812675 • Letter: #

Question

(Using OPENGL - simple graphics - C++)

OBJECT ORIENTED PROGRAMMING

1. The task for this project is simple, create a working Tic-Tac-Toe game.

2. There should be a two player mode, players take turns placing X or O symbols on a 3 × 3 grid.

3. There should also be a single player mode, where the computer should control one of the players.

4. You are free to design the graphics and the classes in any way you want. Even though we will mostly be looking at your working program, code clarity and readability are also important.

5. The AI component does not need to be sophisticated. You will not be penalized if your AI player looses. The only requirement is that it makes valid moves.

6. Your program should be able to detect when a player has won and display an appropriate message.

//Include comments in the code as well please

Explanation / Answer

#define SIDE 3

#define COMPUTERMOVE 'O'

#define HUMANMOVE 'X'

char num[10] = {'o','1','2','3','4','5','6','7','8','9'};

int win()
{
    if (num[1] == num[2] && num[2] == num[3])

        return 1;
    else if (num[4] == num[5] && num[5] == num[6])

        return 1;
    else if (num[7] == num[8] && num[8] == num[9])

        return 1;
    else if (num[1] == num[4] && num[4] == num[7])

        return 1;
    else if (num[2] == num[5] && num[5] == num[8])

        return 1;
    else if (num[3] == num[6] && num[6] == num[9])

        return 1;
    else if (num[1] == num[5] && num[5] == num[9])

        return 1;
    else if (num[3] == num[5] && num[5] == num[7])

        return 1;


void game

{


  
}