← Robotics

Chapter 4: Tell It What to Do

Programming is giving a robot clear steps to follow. This chapter covers sequences, loops, and choices in plain words.

You're browsing as a guest — join with your school invite link to save progress and earn points.

What Is a Program?

A program is a list of steps a computer follows in order. Each step is clear and small, like move forward or turn left. The robot brain reads one step, does it, then reads the next. If a step is unclear, the robot may do the wrong thing. Clear steps make a happy robot.

Loops and Choices

A loop repeats steps, like moving forward until a wall is near. A choice lets the robot pick: if the path is clear, go, and if not, turn. Loops save you from writing the same step many times. Choices help a robot handle surprises. Together they make programs smart and short.

Finding Mistakes

A mistake in a program is called a bug. Finding and fixing it is called debugging. Read your steps slowly and check what the robot actually did. Change one thing at a time and test again. Every programmer debugs, and each fix makes you better.

Check yourself — puzzle games

Pass the game to finish the chapter. No fail — just another go.

Put the Programming Steps in Order

Put these steps in the right order for writing a program.

What Is Debugging?

What is debugging?

Our partners & sponsors

Become a sponsor Questions & Get Involved