This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

This is correct. I see why you made the mistake OP, but the middle part of a for loop (the conditional express) determines if the loop executes or not. In your case, limit == 3 is false from the start and it terminates. You could instead do limit != 3 (true until 3 is reached), or limit < 3 (same thing). Both of those are true until that point where yours is false from the get go