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 as a map, each cell may be an uppercase letter for a fighter (e.g. A and B) or a space for an open space, and I need to write a call function to complete the fight action.
Fight means that if A and B are adjacent to each other in the matrix, and A fights B, B's HP will be reduced, and the reduction value is A's FP. If A and B are not adjacent, the Battle Order is invalid.
Excuse me, how do I do this call function?
(The content of include is iostream and cstring, please do not add new include content)
// TODO: Implement updateMapAndHealthPointsForFightAction
// This function handles the updates based on the fight action
// @param healthPoints: The 1D array storing the health points of warriors
// @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 fightPoints: The 1D array storing the fight points of warriors
// @param letter: The warrior letter that triggers the fight action
// @param direction: The direction enum, please check DirectionType enum
//
// We have 3 parameters that are pass-by-reference. They will be returned to the main function:
// @param targetLetter: The target warrior letter
// @param targetOriginalHealthPoint: The original health point of the target warrior
// @param targetUpdatedHealthPoint: The updated health point of the target warrior
//
// @return The status of the fight action, please check StatusFightAction enum
StatusFightAction updateMapAndHealthPointsForFightAction(int healthPoints[MAX_NUM_WARRIORS],
char map[MAX_ROWS][MAX_COLS],
int mapRows, int mapCols,
const int fightPoints[MAX_NUM_WARRIORS],
char letter,
DirectionType direction,
char &targetLetter,
int &targetOriginalHealthPoint,
int &targetUpdatedHealthPoint)
{
return STATUS_ACTION_FIGHT_NOT_IMPLEMENTED;
}

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!