09-5-2015, 11:32 PM
|
#26
|
Under the scarlet moon
Join Date: Jan 2014
Age: 31
Posts: 921
|
Re: [University - C++ Programming] Help With Assignment (Very Basic Stuff)
Also, if is not a loop, when you have something like:
Code:
if (unsigned int row = 0 && 20) //values in row 0 and 20 are set to WALL
{
tileMap[MAP_WIDTH][row] = WALL; //not sure whether I'm supposed to assign an Ascii Code or just set it to WALL
}
else
{
tileMap[MAP_WIDTH][row] = EMPTY; //any other row set to EMPTY
}
You are:
-Declaring a new int named row with value being '0 && 20', && being logical and (should evaluate to 0)
-Assigning to tileMap[MAP_WIDTH][row], aka tileMap[MAP_WIDTH][0] the value of EMPTY (because 0 evaluates to false).
Last edited by AutotelicBrown; 09-5-2015 at 11:32 PM..
|
|
|