Everyday Learning العربية
Computer scienceInside your phone · Lesson 5 of 6 · 7 min

How does a robot vacuum clean the whole room?

Nobody wrote "go left, go right" for every tile. Someone wrote a few lines and told the robot to repeat them.

In this lesson

A 6 × 4 room. The robot starts top left.

Your notebook page

  • A loop repeats a block of lines.
  • Same program, any size of room.
  • Count moves, not tiles.
  • Off by one = bump.

Where you'll see it today

A robot vacuum, a lawn mower robot, your chat app drawing every message on screen.

The course

Inside your phone

Every lesson adds a part. Finish them all to build the Phone.

  1. 1SearchingHow does your phone find a contact so fast?
  2. 2SortingHow does a playlist sort 1,000 songs?
  3. 3PixelsWhy do photos fill up your phone?
  4. 4PacketsHow does a video reach your phone?
  5. 5LoopsHow does a robot vacuum clean the whole room?
  6. 6Build the phoneWhy do your apps restart when you switch back?
Open in the app Download on the App Store