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:22.090 called a for loop which counts from a starting value up to an ending value by a specific 00:00:22.090 --> 00:00:30.580 increment. For example, a repeat three block counts from 1 to 3 by 1. Every time it counts, 00:00:30.580 --> 00:00:35.750 it runs the code inside the loop. The for loop knows how many times it has run by using 00:00:35.750 --> 00:00:40.129 a counter variable which is set to the starting value at the beginning of the loop and has 00:00:40.129 --> 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:01:01.720 it in your loop. For example, if I have a series of flowers and the first one has one 00:01:01.720 --> 00:01:06.740 nectar, the second one has two nectars and the third one has three, I can use the for 00:01:06.740 --> 00:01:12.470 loop to tell the bee to collect 'counter' nectars each time, which would one at the 00:01:12.470 --> 00:01:18.170 first flower, two at the second and three at the third. Also in a for loop, you can 00:01:18.170 --> 00:01:22.940 increment the counter by a number other than one each time. You can potentially count by 00:01:22.940 --> 00:01:26.780 2s, 4s or even an amount that changes every time through.