Question
char **predictIrmaChange (char* str, Move *irmaMove); Description: This function should start by printing the map board with Irma in its starting position, using the arrangement
char **predictIrmaChange (char* str, Move *irmaMove);
Description: This function should start by printing the map board with Irma in its starting position, using the arrangement described in Appendix A: Irma Movement and the specific format shown in the test case output files included with this assignment. (You will want to call createMapBoard() from within this function to create a 2D char array to represent the map board, and then call the printMapBoard() function to print it to the screen. See above for the descriptions of both of those functions.)
After printing the initial map board, this function should parse all of the algebraic notation strings passed in through making calls to the parseNotationString() function (described below). The printMapBoard() function is called once after the Irmas location has been identified, and another time after the boards final configuration has been processed. Note that this function should print the resulting board (again, with a line of eight equal signs above and below the board each time, always followed by a blank line).
Output: This should print out the map board in the manner described above, with precisely the same format shown in the test case output files included with this assignment.
Return Value: A pointer to the dynamically allocated 2D array (i.e., the base address of the 2D array), or NULL if any calls to malloc() fail.
This is in C and this is what I have so far
char **createChessBoard(void); char **destroyChessBoard(char **board); void printChessBoard(char **board); void playTheGame(void); char **createChessBoard(void) { int ROW = 8, COLUMN = 8, i, j; char **chess = (char **)malloc(ROW * sizeof(char *)); for (i = 0; i char **destroyChessBoard(char **board) { free(board); return NULL; } void printChessBoard(char **board) { int ROW = 8, COLUMN = 8, i, j; char **chess = (char **)malloc(ROW * sizeof(char *)); for (i = 0; i < ROW; ++i){ for (j = 0; j < COLUMN; ++j){ printf(" %d ", chess[i][j]); } puts(""); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started