Repeating Events

Something that happens over and over again. In coding, loops are used to repeat instructions.

In the above example BB8 can collect all the scrap metal by using a sequence of moves, but in order in order to use the fewest blocks possible we need to use a loop

In the example above BB8 can now collect all of the scrap metal using fewer blocks. Adding loop blocks to our code to replace the repeating events makes our code more efficient. The video below shows the process of creating the code with loop blocks. This example corresponds with Mathematics Grade 3 C3.1

Grade 3 - Repeating Events.mp4

Try it now!

To practice with repeating events, access this sample activity from Course C of studio.code.org ⤵️

Examples of repeating events are taken from studio.code.org, Course C (2020). https://studio.code.org/s/coursec-2020