Repeat count
Run the commands a fixed number of times.
Topic Guide
Loops repeat a group of commands. The programmer chooses what repeats, how often, and when it stops.
A game checks for collisions many times each second. A robot keeps reading its distance sensor. Putting that work in a loop makes the repeated rule easy to see and change.
A traffic signal repeats a cycle, but it cannot simply flash every light at once. The sequence, timing, and stopping rule are part of the loop.
Run the commands a fixed number of times.
Keep running them while the project is active.
Check a condition and stop when it becomes true.
One trip through the loop.
Launch each hazard after a controlled delay.
Repeat costume changes at a readable speed.
Move along the route and check for obstacles each time.
Subtract one after each timed interval.
Program connections
Students author games, animations, simulations, and strange interactive stories while learning how events, rules, and state fit together.
Students write commands, wire simple circuits, read sensors, and trace physical cause and effect through the Sense–Decide–Act loop.
A possible later step from visual programming into Lua, 3D objects, events, and larger game rules.
The program never reaches the blocks beneath it.
The repeat-until loop has no way to finish.
One timing change has to be repaired in twenty places.
The loop runs so quickly that the result cannot be seen or controlled.
Defend a mug of cocoa from falling snowballs. Each wave gets faster, and winter becomes less reasonable.
See how it worksDesign a repeating patrol that notices an obstacle, tries a response, and checks whether the response worked.
See how it worksBuild a one-room platform game with a controlled jump, safe platforms, lava, and a clean restart.
See how it works