1 00:00:06,149 --> 00:00:11,059 When you use a repeat block to loop your code, how does the computer know when it's repeated 2 00:00:11,059 --> 00:00:16,610 enough times? The repeat block is actually hiding a more sophisticated piece of code 3 00:00:16,610 --> 00:00:22,840 called a for loop which counts from a starting value up to an ending value by a specific 4 00:00:22,840 --> 00:00:31,330 increment. For example, a repeat three block counts from 1 to 3 by 1. Every time it counts, 5 00:00:31,330 --> 00:00:36,500 it runs the code inside the loop. The for loop knows how many times it has run by using 6 00:00:36,500 --> 00:00:40,869 a counter variable which is set to the starting value at the beginning of the loop and has 7 00:00:40,869 --> 00:00:45,070 the increment added to it each time the loop is run. As soon as the counter variable is 8 00:00:45,070 --> 00:00:52,110 greater than the ending value, the loop stops running. The benefit of using a real for loop 9 00:00:52,110 --> 00:00:56,220 instead of the repeat block is that you can actually see the counter variable and use 10 00:00:56,220 --> 00:01:02,470 it in your loop. For example, if I have a series of flowers and the first one has one 11 00:01:02,470 --> 00:01:07,490 nectar, the second one has two nectars and the third one has three, I can use the for 12 00:01:07,490 --> 00:01:13,220 loop to tell the bee to collect 'counter' nectars each time, which would one at the 13 00:01:13,220 --> 00:01:18,900 first flower, two at the second and three at the third. Also in a for loop, you can 14 00:01:18,900 --> 00:01:23,690 increment the counter by a number other than one each time. You can potentially count by 15 00:01:23,690 --> 00:01:27,530 2s, 4s or even an amount that changes every time through.