🐞 Chapter 3: Debugging · Level 18 of 30
Level 18: Nested Loop Bug
Goal: The robot turns too early and bumps a rock. Fix the inner loop. ★★★ = 4 blocks or fewer.
▶ Watch how it works
A loop inside a loop with a bug. Check what one round does.
Got it? Now solve your puzzle ↓ (a different board — work it out yourself!)
Blocks — tap to add
Your program
💡 Need a hint?
Count the squares along one side. The inner repeat needs that number.
What you learn here
Check each loop on its own: what does one round do? Then check how many rounds you need.
Chapter 3 — Debugging: Each level starts with a program that has a mistake. Run it, watch where it goes wrong, and fix it.
Blocks in this level
- ⬆️move forwardThe robot moves one square the way it is facing.
- ↪️turn rightThe robot turns to its right on the same square.
- 🔁repeatRuns the blocks inside it again and again — tap − and + to choose how many times.