I need to print a 'T' at the location of the treasure for my 2D array. I am having trouble with this. I have a global constant where TREASURE = 'T'...when I print my map it prints the treasure location after the map instead of at the actual location. I have to do the same for my Start location. Code:
void PrintMap(const char Map[][COLS], const bool showTreasure)
{
int TreasureR, TreasureC;
int StartR, StartC;
for (int row = 0; row < ROWS; row++)
{
for (int col = 0; col < COLS; col++)
{
if ((row == TreasureR && col == TreasureC) && showTreasure == true)
cout << Map[row][col];
else if ((row == StartR && col == StartC) && showTreasure == true)
cout << START;
else
cout << EMPTY;
}
cout << endl;
}
}