Question: I ' m doing a C + + programming assignment where there is a part of the call function that looks like this: A two

I'm doing a C++ programming assignment where there is a part of the call function that looks like this:
A two-dimensional matrix is used as a map, and each cell may be a capital letter (such as A) or a space, and I need to write a call function to complete the movement of the letters up and down, left and right in the map.
If it hit an edge or another letter while moving, the move command is invalid. Excuse me, how do I implement this call function.
// TODO: Implement updateMapForMoveAction
// This function handles the updates based on the movements
// @param map: The 2D array storing the map information
// @param mapRows: The number of rows for this map
// @param mapCols: The number of columns for this map
// @param letter: The warrior letter to be moved
// @param direction: The direction enum, please check DirectionType enum
// @param moveSteps: The number of movement steps
//
// @return The status of move action, please check StatusMoveAction enum
StatusMoveAction updateMapForMoveAction(char map[MAX_ROWS][MAX_COLS], int mapRows, int mapCols,
char letter, DirectionType direction, int moveSteps)
{
return STATUS_ACTION_MOVE_NOT_IMPLMENTED;
}

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 Programming Questions!