Topics Covered:
Use this lesson to start thinking in computer terms. The code you give a computer must be very precise, so here you'll start to identify exactly when something in a program should happen.
Use this simple 'if' statement to experiment with the structure of 'if' statements. Move the position = 0; command outside of the closing brace } of the 'if' statement. Now what happens? The variable reset happens every loop, not only if the condition is true.
This is another instance of styling and syntax being very important to pay attention to, which is why we line up the closing brace } with the first letter of the 'if' it goes with. By using this practice, you can almost always 'trace' a closing brace up to the the statement that contains its opening brace.