
Originally Posted by
Moon Rabbits
However, when I run the program only 9 columns are drawn when I call the function to draw my bricks. Why is this?
Code:
for(int i = 0; i < NUM_COLUMNS; i++)
If NUM_COLUMNS is set to 9, then 9 columns is all you're going to get. Remember, it's while i is <i>less than</i> 9. Thus the loop will be processed while i is equal to 0, 1, 2, 3, 4, 5, 6, 7 and 8, a total of 9 times.
Also, if you want to show code on the page, wrapping it in [c<i></i>ode] tags rather than [qu<i></i>ote] tags works rather nicely.