Hour of Code: Code with Mary

Part 4: Clothing Picker


Control Structures: Repeat

If we want the computer to repeat a task multiple times, we can use a loop in our program. This is usually a lot less work than typing the instruction repeatedly and more flexible because we can have the instructions executed a variable number of times.

In Quorum, we create a loop using the keyword repeat.

We mark the end of a loop in the same way we marked the end of an if statement, by using the keyword end.

In this example, we will explore three different ways to control loops using the statements: repeat {number} times, repeat while {condition} and repeat until {condition}.

Try it Yourself

Next Tutorial

In the next tutorial, we will discuss Hour of Code Part 5, which describes first steps in Quorum.