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

I need a C++ code (going to be run in linux) that will satisfy this game. I have

ID: 3693885 • Letter: I

Question

I need a C++ code (going to be run in linux) that will satisfy this game. I have been working on an answer but I can not seem to come up with the right combination of code. Need this quickly! I'll include what I have so far first and the problem at the end. I basically need a check function to see if im returning the right values.

#include <iostream>

Using namespace std;

char square[ ] = {}; [COMPLETE ME]

int checkwin();

void board();

int main() {

int player = 1,i,choice;

char mark; //For the player pieces

do{ board();

player=(player%2)?1:2; //Determines whose player 1 and 2

cout << "Player " << player << ", enter a number: ";

cin >> choice;

mark=(player == 1) ? 'B' : 'R'; //1= Black 2=Red

{ cout<<"Invalid move ";player--; }

i=checkwin();

player++;

}

while(i==-1);

board();

if(i==1)

cout<<"==>Player "<<--player<<" win ";

else cout<<"==>Game draw";

return 0;

}

/*** FUNCTION TO RETURN GAME STATUS 1 FOR GAME IS OVER WITH

RESULT -1 FOR GAME IS IN PROGRESS O GAME IS OVER AND NO RESULT **********************************************/

int checkwin() { } //Maybe if-statements

/******************************************************************* FUNCTION TO DRAW BOARD, (needs a 2x2 array)********************************************************************/

void board() { clrscr();

cout << " Tic Tac Toe ";

cout << "Player 1 (X) - Player 2 (O)" << endl << endl;

cout << endl;

cout << " | | " << endl;

cout << " " << square[1] << " | " << square[2] << "|" << square[3] << endl;

[COMPLETE ME]

Explanation / Answer

I found no error in that coding function at the end it was perfectly all right!!!!

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