Instructions for Computers: Giving Robots Step-by-Step Commands
Imagine you have a robot friend named BIT. BIT can do lots of things โ move forward, turn left, pick up a block โ but BIT needs you to tell it EXACTLY what to do, one step at a time. If you say 'clean my room,' BIT just stands there blinking. Computers are like BIT: they are very powerful, but they need clear, step-by-step instructions.
What You'll Learn
- What a computer instruction is - Why the ORDER of steps matters - How to write instructions that a computer or a robot friend can follow - What happens when an instruction is missing or out of order
What Is a Computer Instruction?
A computer instruction is one exact thing you tell a computer to do. Computers can only follow ONE instruction at a time, and they do exactly what you say โ nothing more, nothing less. Here are some computer instructions: - Move forward 3 steps - Turn right - Pick up the red block - Say Hello! Each instruction is short, clear, and does just ONE thing. A list of instructions in order is called a program!
When you play a video game, the computer is following millions of instructions every second! Each time your character jumps, runs, or collects a coin, the game ran a list of instructions to make it happen. Programmers wrote all those instructions โ and you can learn to do the same thing!
The Peanut Butter Sandwich Test
Here is a famous experiment: pretend you are telling a robot how to make a peanut butter sandwich. If you say: 'Put peanut butter on the bread,' the robot might try to pour the whole jar onto a loaf still in the bag โ because you did not say: 1. Open the bread bag 2. Take out two slices 3. Open the peanut butter jar 4. Pick up a knife 5. Dip the knife into the peanut butter 6. Spread peanut butter on one slice 7. Put the other slice on top Computers are like that robot! They need EVERY step spelled out.
The Order Matters!
What if you told a robot: 'Put on your shoes, then put on your socks'? The robot would try to squeeze socks over shoes โ that makes no sense! In coding, the ORDER of instructions is called SEQUENCE. Getting the sequence right is one of the most important jobs a programmer has. If the steps are out of order, the program goes wrong โ just like the shoes-before-socks problem.
Be the Robot!
Play this game with a partner: One person is the PROGRAMMER. One person is the ROBOT. The Robot must follow every instruction EXACTLY as said โ no guessing allowed! The Programmer writes exactly 5 step-by-step instructions to guide the Robot from one side of the room to a chair and sit down. The Robot follows only what is written. After the Robot finishes (or gets confused!), switch roles and try again. Talk about: Which instructions were missing? What happened when a step was out of order? Write down the PERFECT set of instructions that worked both times.
Your robot friend BIT needs to pour a glass of water. Which list of instructions is in the CORRECT sequence?
What is a computer program?
Flashcards โ click each card to reveal the answer
Want to keep learning?
Sign up for free to access the full curriculum โ all subjects, all ages.
Start Learning Free