Loops: Simplifying Repetitive Action
Simplify Projects with Loops
We, as humans, repeat many behaviors in our daily lives. From eating and sleeping to brushing our teeth and walking our dogs, much of what we do each day is repetitive. In math class, we know that multiplying a number by zero, will always equal zero or that multiplying a number by one will always equal itself, no matter how many times we do it. While we have a tendency to repeat our behaviors, our instructions can sometimes be simplified. For example, if you’re using a recipe to bake a cake, it wouldn’t tell you to “add 1 cup of sugar, add 1 cup of sugar, add 1 cup of sugar, add 1 cup of sugar.” Instead, it would simply tell you to add four cups of sugar.
With robots, Loops help us simplify our projects. Instead of adding the same block four times, for example, we can use a Loop to tell the robot to perform the same behavior four times, saving time and space as we build our projects. Imagine a task that a robot might perform that would require repetition to complete the task. Those behaviors, along with a Loop block from the Control block category, are what you would need to project to achieve the task.