WEBVTT 00:00:05.399 --> 00:00:10.309 When you use a repeat block to loop your code how does the computer know when it's repeated 00:00:10.309 --> 00:00:15.860 enough times? The repeat block is actually hiding a more sophisticated piece of code 00:00:15.860 --> 00:00:21.590 called a for loop which counts from a starting value up to an ending value by a specific 00:00:21.590 --> 00:00:30.630 increment. For example, a repeat 3 block counts from 1 to 3 by 1. Every time it counts, it 00:00:30.630 --> 00:00:35.820 runs the code inside the loop. The for loop knows how many times it has run by using a 00:00:35.820 --> 00:00:40.019 counter variable that is set to the starting value at the beginning of the loop and has 00:00:40.019 --> 00:00:44.309 the increment added to it each time the loop is run. As soon as the counter variable is 00:00:44.309 --> 00:00:51.360 greater than the ending value the loop stops running. The benefit of using a real for loop 00:00:51.360 --> 00:00:55.470 instead of the repeat block is that you can actually see the counter variable and use 00:00:55.470 --> 00:00:56.160 it in your loop.