My bricks don't fully print. I get:
XXXXXXXXXX
XXXXXXXXX
XXXXXXXXX
XXXXXXXXX
XXXXXXXXX
I can't figure out why I am missing the first brick in each of rows 2-5
initBricks(window);
{
int Bricks + COLS * ROWS;
int count = 0;
int x = 0;
int y = o;
for (int i = o; i < ROWS; i++) // create the bricks
{
for (intj = 0; j < COLS; j++)
{ //check for obly 10 bricks per row
if (x >= 400)
{
x = o;
Y = Y + HGTBRK; //HGTBRK == 15; WDBRK == 40;
}
else
{
GRect bricks = newGRect(x, y, WDBRK - 5, HGTBRK - 3);
add (window, bricks);
}
// then I have a switch statement that chooses color randomly. That works.
switch
}
code
}
x = x + WDBRK; // I am adding the new brick
count++;
}
if(count >= Bricks)
break;
}
}