Thank you for replying Andy!
More often what I have seen for something like this is: for(int blanks = 5; blanks > 0; blanks--) |
Yes, it's much easier to understand in that form. But I want to understand it in the form I gave :)
The reason it goes backward is because the value of "scale" decreases each time through the loop. Since "scale" starts with a high number |
Yes, according to line 27, the scale does decrease by 1, with every iteration.
But I guess what I should have asked is, from what value does scale starts? You say that is starts with a
"high number", but, what number is that? See, inside the first
if, in line 14, scale is said to be equal to x, which makes things easy. But inside the second
if, no such declaration of scale is given! So how am I supposed to calculate
scale = scale - 1?
I assume (probably wrongly) that scale=6, since up to line 50; we went through the values 0, 1, 3, 4, 5 and 6. Am I right?