Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago