Please enable JavaScript to use CodeHS

What You Can Do With Computers

How to Give Instructions

A computer does exactly what you tell it to do. Learn how to write clear instructions a robot can follow.

Beginner ~8 min Elementary
The Big Idea

Code is a list of instructions

A computer is like a robot that does exactly what you tell it to do. A program is a list of instructions, and each instruction is one small step. If the steps are in the right order, the computer does what you want.

Think about getting ready for school. You might put on socks, then shoes, then tie your shoes. If you tie your shoes before you put them on, it does not work. Order matters!


How It Works

Computers follow every step

Computers do not guess. They read each instruction one at a time, from top to bottom. They do not skip ahead, and they do not know what you meant. They only know what you wrote.

That is why good instructions are:

  • Clear: each step means one thing.
  • In order: the steps are listed from first to last.
  • Complete: nothing important is missing.

Interactive

Program the robot

Click buttons to give the robot commands. Then press Run and see if the robot reaches the green target.

Click a command to add it.

Your Turn

Check yourself

Write the steps to brush your teeth. Be specific and put them in order.

Sample answer: 1. Pick up my toothbrush. 2. Put toothpaste on it. 3. Brush my teeth for two minutes. 4. Rinse my mouth. 5. Put the toothbrush away.


Check Yourself

Quick quiz

1. Which step should come first?

2. What happens if instructions are out of order?

3. Why do computers need exact instructions?

Keep learning

You know how to give instructions. Next, see what you can make with code.

Part of the What You Can Do With Computers series.