Unit 1 · Coding for Kids · Grades 1–3
Sequences: Put the Steps in Order
How do you tell a robot what to do?
Imagine you have a toy robot. You say, “Go get my ball!” The robot just sits there. It does not know where the ball is. It does not know how to walk to it. It needs steps.
Coders give computers and robots steps, one at a time, in just the right order. Let’s learn how.
The big idea: A sequence is a set of steps in order. Computers do the steps exactly as written, one after another. So the order and the words matter.
1. What is an algorithm?
An algorithm (say it: AL-guh-rith-um) is a list of steps that gets a job done.
You use algorithms every day! Brushing your teeth is one. Getting ready for school is one. Cleaning up your classroom is one too.
Here is an algorithm for brushing your teeth:
- Wet your toothbrush.
- Put a small dab of toothpaste on it.
- Brush all your teeth, front and back.
- Spit out the toothpaste.
- Rinse your toothbrush.
People write algorithms for computers, too. When an algorithm is written so a computer can follow it, we call it a program.
2. Steps in a row: sequences
A sequence is a set of steps done in order, one after another. First this, then that, then the next thing.
A computer starts at the first step. It does that step. Then it moves to the next one. It keeps going until the steps run out.
Words like first, next, then and last help us talk about sequences.
3. Order matters
Some steps must happen before others. Think about getting dressed. You put on your socks first. Next you put on your shoes. Last, you tie the laces.
What if we mix up the order? Shoes first, then socks? That would be silly! The socks can’t go on under the shoes.
Some steps can trade places and still work. You could put on your left sock or your right sock first. But many steps can’t trade places. A good coder checks which steps must come first.
4. Say it exactly
People are good at guessing what you mean. Computers are not. A computer follows each instruction exactly as it is written, even when that is not what you wanted.
So coders make each step precise. Precise means clear and exact.
| Fuzzy step | Precise step |
|---|---|
| Go over there. | Take 4 steps forward. |
| Turn a bit. | Turn right. |
| Draw a shape. | Draw a square. |
Try it: Ask a grown-up to be a “robot” who does only exactly what you say. Tell them how to sit down in a chair. Did you forget any steps?
5. Meet the turtle
Long ago, in 1967, a team that included Seymour Papert made a coding language for learning. It is called Logo.
Logo had a helper called the turtle. The first turtle was a small robot that moved on the floor. Children typed commands, and the turtle followed them. Later, the turtle moved onto the computer screen, where it could draw pictures with its path.
Our turtle understands three steps:
- Step forward: move one square the way it is facing.
- Turn right: turn in place a quarter turn to its own right.
- Turn left: turn in place a quarter turn to its own left.
A turn does not move the turtle to a new square. It only changes which way the turtle faces.
6. Bugs and debugging
Sometimes the steps do not work. The turtle ends up in the wrong place. That is OK! It happens to every coder.
A mistake in a program is called a bug. Finding and fixing the mistake is called debugging.
Here is a way to debug:
- Look. Where did the turtle go? Where did you want it to go?
- Walk through it. Read the steps one at a time. Point to where the turtle would be after each step.
- Find the step that went wrong. Is a step missing? Is there an extra step? Are two steps in the wrong order?
- Fix it and try again.
Often, a bug is just two steps in the wrong order. Swapping them can fix it. Each bug you fix teaches you something new about your steps.
Try the interactive turtle lab at jugami.com/kid-coding/sequences/
7. Turtle lab
The turtle starts in the bottom left square, facing up. It understands three steps: Step forward, Turn left and Turn right. A turn happens in place.
Puzzle A: Fix the bug
These steps should take the turtle to the star, but one step is in the wrong place. Use the Move up and Move down buttons to change the order. Then run it.
Puzzle B: Write your own
Now the star is in a new place. Add steps one at a time to get the turtle there. There is more than one way!
8. Be the robot: an unplugged game
You don’t need a computer to code! Play this game with a friend or a grown-up.
- Pick a spot in the room, like the door. That is the goal.
- One person is the coder. The other is the robot.
- The coder plans the steps first, using only “Step forward,” “Turn left” and “Turn right.” Say them out loud or write them down.
- The robot does each step exactly, and nothing else.
- Did the robot reach the goal? If not, debug the steps and try again. Then switch jobs!
Grown-up note
Agree on what one “step” means before you start (for example, one heel-to-toe step). Clear the path of anything that could trip someone. When playing robot, follow the words literally, so children see why precise, ordered steps matter.
Practice problems
Worksheet 1: Order the steps Worksheet 2: Turtle paths
Open a worksheet and use your browser’s Print command to print it. The worksheets use new examples, not the ones on this page, and they have no answer key.
- Write an algorithm with 4 steps for getting ready for bed. Use the words first, next, then and last.
- Look at your list. Which two steps could trade places and still work? Which two could not?
- Change one fuzzy step into a precise step. Read it to someone. Could they follow it exactly?
Try the interactive self-guided quiz at jugami.com/kid-coding/sequences/
Self-guided quiz: steps in order
Choose one answer for each question. Pick a choice to see a hint about why it is right or what to reread.
Score: 0 of 8 · 0 answered
Sources
We checked the facts on this page with these sources.
- K–12 Computer Science Framework: statements by concept — what children in grades K–5 learn about algorithms, sequences of instructions and debugging; computers follow instructions exactly as given.
- CS Unplugged (University of Canterbury): Kidbots — an unplugged activity where children give a “robot” instructions, test them, and track down bugs.
- Logo Foundation (MIT Media Lab): Logo History — the first Logo was made in 1967 by a team Seymour Papert worked with; the first turtle was a robot on the floor.
- Logo Foundation (MIT Media Lab): A Logo Primer — the turtle moves with commands like forward and right, and debugging is part of working in Logo.
- MIT News: Professor Emeritus Seymour Papert dies at 88 (2016) — Seymour Papert’s life (born 1928 in Pretoria, South Africa; died 2016) and his work on children, computers and learning.
Lesson text, drawings, the turtle lab and share cards are original Jugami work made for this course. No historical quotations are used. Our teacher Seymour is a friendly character inspired by Seymour Papert (1928–2016); he is not a real person speaking.