Question: (C++ only) write this code in C++ only please and make sure that all of outputs must be the same with the following instruction. Also,

(C++ only)

write this code in C++ only please and make sure that all of outputs must be the same with the following instruction.

Also, you shouldn't use any pointer.

I attached the Connect-4 code at the bottom, which you need to use for this question.

(C++ only) write this code in C++ only please and make surethat all of outputs must be the same with the following instruction.Also, you shouldn't use any pointer. I attached the Connect-4 code atthe bottom, which you need to use for this question. #include using

#include  using namespace std; const int RSIZE = 6; const int CSIZE = 7; const char BLANK = '.'; const char P1 = 'X'; const char P2 = 'O'; char winner(char board[RSIZE][CSIZE]); string play(char board[RSIZE][CSIZE], int col, char who); bool fourInARow(char board[RSIZE][CSIZE], int i, int j, int dr, int dc); void print(char board[RSIZE][CSIZE]); ---------------------------------------------------------------------------------------------------------------- Source code for this question int main() { char board[RSIZE][CSIZE]; for(int i=0; i> ans; string dump; getline(cin, dump); if('1' = 0 && cj = 0 && board[i][j] == board[ci][cj]) // in the board bounds and in a streak { sum++; ci += dr; cj += dc; } ci=i-dr; cj=j-dc; while(ci = 0 && cj = 0 && board[i][j] == board[ci][cj]) // count in the opposite direction too { sum++; ci -= dr; cj -= dc; } return sum >= 4; } string play(char board[RSIZE][CSIZE], int col, char who) { for(int i=RSIZE-1; i >= 0; i--) { if(board[i][col] == BLANK) { board[i][col] = who; return ""; } } return "That column is full (idiot)."; } void print(char board[RSIZE][CSIZE]) { cout   Problem B: Loading games (20 points) Add functionality to either the base connectFour.cpp or your answer to part A to press '' to load a game from "save.txt". If this file does not exist, you should not change the current board. Otherwise, you should change the board and let the user play the saved board normally. Note: You may assume the the "save.txt" is in a valid board for the game. Example 1 (user input is underlined, note that the game would continue but I do not show more): 1234567 Which column do you wish to play in? Or (s)ave/(1) oad? 1234567  Problem B: Loading games (20 points) Add functionality to either the base connectFour.cpp or your answer to part A to press '' to load a game from "save.txt". If this file does not exist, you should not change the current board. Otherwise, you should change the board and let the user play the saved board normally. Note: You may assume the the "save.txt" is in a valid board for the game. Example 1 (user input is underlined, note that the game would continue but I do not show more): 1234567 Which column do you wish to play in? Or (s)ave/(1) oad? 1234567

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!