Program 2: The ball moves until it reaches the end of the stage.

The repeat until loop in Scratch executes the statements inside the loop until the specified event happens. The event used in the repeat loop in program 2 is “touching the edge” which corresponds to reaching the edge of the stage.This implies that the ball moves to the right until it touches the edge of the stage.

For teachers already familiar with Python, we point out that repeat until loops are similar to while loops in Python. In particular, “repeat until touching the edge” corresponds to “while not touching the edge”.

image003

 Program 2

The statement “set x to 0” positions the circle to be at the middle of the stage. The circle then moves to the right. The statements inside the repeat-until loop are executed until the circle touches the edge. This means the circle rolls until it reaches the right edge of the stage.

Having circles or other objects roll around the stage is a great way to try different conditions.  Students generally like these problems and many create interesting new versions. Video Length: 2:41