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

Chapter 3 levels