Question: #include #include int win(char board[6][6], char player) { // insert your code for the function here return -1; } int main() { //initialize the array

 #include #include int win(char board[6][6], char player) { // insert your
#include
#include
int win(char board[6][6], char player) {
// insert your code for the function here
return -1;
}
int main() {
//initialize the array
char board[6][6];
int i,j;
char user;
int gameresult;
//read in the board
printf("Enter 36 values for the 6x6 game board ");
for(i=0;i
for(j=0;j
scanf("%c ",&(board[i][j]));
}
}
// print the board
for(i=0;i
for(j=0;j
printf("%c ",(board[i][j]));
}
printf(" ");
}
printf("Enter the uesr's token to see if they won the game!");
scanf("%c",&user);
printf(" ");
gameresult = win(board,user);
if (gameresult == 1)
printf("Player %c won the game!",user);
else if (gameresult == 0)
printf("Player %c didn't win.",user);
else
printf("invalid response from win() ");
return 0;
}
Write a function win0 with the following prototype int win(char board[61(6], char player) The function win should return a 1 if the character player is found in three consecutive positions in the board Consecutive for this lab means in the same row, or in the same column, NOT on a diagonal. For the board shown below B B D E G The following values should be returned by win0 if called as: win(board'A) would return win(board:8) would return O win(board D) would return O win(board G) would return 1 win(board O) would return 0 win(bo win(board, Z) would return 1 s points will be for the autograded tests, the remaining S points will be for a header with your nome () point), approprinte sityle (2 point d approp iate comiments (2 paints)

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!