Course Solutions Uncategorized (Solved) : Need Make Changes C Program Include Using Namespace Std Const Int Rows 3 Const Int Cols 3 Q36078210 . . . .

(Solved) : Need Make Changes C Program Include Using Namespace Std Const Int Rows 3 Const Int Cols 3 Q36078210 . . . .

 

I just need to make these changes in my c++ program
Extra Credit Opportunity You may work on this if you have fully completed the previous Tic Tac Toe exercise in Zybooks Replac
#include<iostream>

using namespace std;

const int ROWS=3;

const int COLS=3;

void fillBoard(char [][3]);

void showBoard(char [][3]);

void getChoice(char [][3],bool);

bool gameOver(char [][3]);

int main()

{

char board[ROWS][COLS];

bool playerToggle=false;

fillBoard(board);

showBoard(board);

while(!gameOver(board))

{

getChoice(board,playerToggle);

showBoard(board);

playerToggle=!playerToggle;

}

return 1;

}

void fillBoard(char board[][3])

{

for(int i=0;i<ROWS;i++)

for(int j=0;j<COLS;j++)

board[i][j]=’*’;

}

void showBoard(char board[][3])

{

cout<<” 1 2 3″<<endl;

for(int i=0;i<ROWS;i++)

{

cout<<(i+1)<<” “;

for(int j=0;j<COLS;j++)

{

cout<<board[i][j]<<” “;

}

cout<<endl;

}

}

bool gameOver(char board[][3])

{

bool win=false;

for(int i=0;i<3;i++)

{

if(board[i][0]==’X’ &&board[i][1]==’X’ &&board[i][2]==’X’)

{

cout<<“nPlayer 1 Wins!”<<endl;

win=true;

return win;

}

if(board[0][i]==’X’ &&board[1][i]==’X’ &&board[2][i]==’X’)

{

cout<<“nPlayer 1 Wins!”<<endl;

win=true;

return win;

}

}

if(board[0][0]==’X’ && board[1][1]==’X’ &&board[2][2]==’X’)

{

cout<<“nPlayer 1 Wins!”<<endl;

win=true;

return win;

}

if(board[0][2]==’X’ && board[1][1]==’X’ &&board[2][0]==’X’)

{

cout<<“nPlayer 1 Wins!”<<endl;

win=true;

return win;

}

for(int i=0;i<3;i++)

{

if(board[i][0]==’O’ &&board[i][1]==’O’ &&board[i][2]==’O’)

{

cout<<“Player 2 Wins!”<<endl;

win=true;

return win;

}

if(board[0][i]==’O’ &&board[1][i]==’O’

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 4 Use Dijkstra S Algorithm Find Shortest Path Node E Node B Length Following Graph 7 8 Mar Q26176657 . . . .(Solved) : 4 Use Dijkstra S Algorithm Find Shortest Path Node E Node B Length Following Graph 7 8 Mar Q26176657 . . . .

<p><img alt="4. Use Dijkstras algorithm to find the shortest path from node e to node b, and its length in the following graph. 7 (8 marks)" src="http://d2vlcm61l7u1fs.cloudfront.net/media%2F516%2F51697c58-7229-4ffa-bd3a-00bedfcf53bd%2FphplYG0NG.png" aria-describedby="d3f"/></p><p>i want all