Robots Follow Programs
Imagine you are teaching a younger sibling to make a peanut butter sandwich. You cannot just say 'make a sandwich' — they need every single step! Get the bread. Open the jar. Spread the peanut butter. Put the slices together. Done! That list of steps is a lot like what a robot uses. It is called a program. A program is a set of instructions that tells a robot exactly what to do, in exactly what order.
What Is a Program?
A program is a list of instructions written by a person — a programmer — and stored inside the robot's brain. When the robot is turned on, it reads the program from the very first instruction and follows each one in order. Programs are very precise. The robot does not skip steps. It does not add extra steps. It does not decide to do things differently today because it feels like it. It follows the program, step by step, every single time. This is why robots are so reliable. If you program a robot to sort red blocks into one bin and blue blocks into another, it will do that perfectly all day without getting tired, bored, or distracted.
A program is a set of step-by-step instructions stored in a robot's brain. The robot reads those instructions and follows them, one by one, in order. Programs make robots predictable and reliable.
Here is a simple robot program written in plain words: Step 1: Roll forward for two seconds. Step 2: Stop. Step 3: Look left with the camera. Step 4: If a red block is spotted, pick it up. Step 5: Turn around and roll back. Step 6: Drop the block in the bin. Step 7: Go back to Step 1. Notice the last step — go back to Step 1! Many robot programs loop. They repeat the same set of instructions over and over until someone turns the robot off. A factory robot might run the same program thousands of times a day picking up parts on an assembly line.
Match each programming word to what it means.
Terms
Definitions
Drag terms onto their definitions, or click a term then click a definition to match.
Programs have to be very specific. Vague instructions do not work for robots. Imagine telling a robot: go over there. Where is 'there'? The robot has no idea. It needs exact instructions: roll forward 50 centimeters, then turn left 90 degrees. This is one of the tricky things about writing programs. The programmer has to think through every single detail. If even one step is missing or wrong, the robot will do something unexpected — or nothing at all. Programmers sometimes call this a bug. A bug is a mistake in a program that causes the robot to behave in the wrong way.
A robot cannot fill in the blanks. If the program does not cover a situation, the robot gets confused or does the wrong thing. Every possibility has to be planned for in advance by the programmer.
Fill in the missing words to complete the sentences.
Why are robots so reliable at doing the same task over and over?
A programmer tells a robot 'go over there.' What is the problem?
Write a Robot Program
- You are going to write a program for a pretend robot!
- Choose a very simple task: walk from your chair to the front door, or stack three books on a table.
- Write out every single step the robot needs to do. Number each step.
- Be as specific as possible — use directions (left, right, forward), counts (two steps, three seconds), and exact actions (pick up, put down, turn).
- When you are done, ask a friend or family member to be your robot. Read your program out loud — they must follow ONLY what you say, exactly as written.
- Did the robot complete the task? If not, which step was missing or too vague? Fix it and try again!