[solved]-Must C Programming Q1 Write C Function Allows User Initialize Tic Tac Toe Board Board 2d A Q39022915
MUST BE IN C PROGRAMMING!!!
Q1.) Write a C function that allows the user to initialize aTic-Tac-Toe board. The board is a 2D array of size 3×3. Thefunction will set an id for each cell of the board starting from 1and stop at 9. The function prototype is void InitializeBoard(intm, int n , char board[][n]) This was given to get theproblem started.
void InitializeBoard(int m, int n , char board[][n]){
int c =1;
for(int i =0; i<m; i++){
for(int j=0; j<n; j++){
board [i][j] = c+’0′;
c++;
}
}
}
}
Q2.) Write a C function that allows the user to print aTic-Tac-Toe board. The function prototype is void PrintBoard(int m,int n, char board[][n]).
Q3.) Write a C function that allows the user to create aTic-Tac-Toe board. In this case, the board is a 2D array of size3x3, The function allows the user to create a board and set some Xor O on the board at any cell. The function prototype is voidCreateBoard(int m, int n, char board[][n]).
If the user typed any invalid input like cell number 21 orrather than entering X or O the user typed C the function shouldignore his input and ask him to enter a valid input. Here is anexample of this behavior.
Q4.) Write a C function that allows the user to check if a givenTic-Tac-Toe board is a valid board or an invalid board. The boardis valid if it is an empty board or if the difference between thetotal number of X and the total number of O symbols on the board is0 or 1. The function prototype is int IsValidBoard(int m, int n,char board[][n]).
Q5.) Write a C function that allows the user to find if any nextmove or next play for any player X or O who has the turn to play iswinning move. The function will print the cell number or ID that ifthe player places an X or O in it he/she will win the game. Ifthere is more than one cell where the player could place his symbolin and win the game the function should print all the winning cellsfor that player. The function prototype is voidListWinningCells(int m, int n, char board[][n])
Q6.) Write a main function that displays a menu for the user andasks him to select which function he/she wants to test. Here is asample output of the main function
Expert Answer
Answer to MUST BE IN C PROGRAMMING!!! Q1.) Write a C function that allows the user to initialize a Tic-Tac-Toe board. The board is… . . .
OR

