Chapter 4: Conditions · Level 24 of 30

Level 24: Smart Robot

Goal: This path turns both ways. Make a rule that tries right, and if that is blocked too, turns to the left. ★★★ = 8 blocks or fewer.

▶ Watch how it works

An if inside an if: blocked ahead? Turn right and check again. Still blocked? Turn back the other way.

Got it? Now solve your puzzle ↓ (a different board — work it out yourself!)

Blocks — tap to add

Your program

💡 Need a hint?

If path ahead: forward. Else: turn right, then another “if path ahead”: forward — else turn left two times.

What you learn here

An if block can sit inside another if block. Smart programs check one thing, then another.

Chapter 4 — Conditions: Teach the robot to decide for itself: keep going until the star, and turn only when the path is blocked.

Blocks in this level

Chapter 4 levels