Sequences: Order Matters
Socks before shoes! Learn how a sequence works, why mixing up the order breaks a plan, and how to write exact steps a robot can follow.
Welcome back!
Step 1 of 12Learn
One after another
A sequence is a set of steps that happen one after another, in a set order.
Order matters a lot. Try this plan for getting dressed:
- Put on shoes
- Put on socks
Silly, right? The steps are all there, but in the wrong order. Swap them and the plan works.
Computers follow a sequence from the top down, one step at a time. They never skip ahead and they never go back unless you tell them to.
Step 2 of 12Practice · Put in order
Put the steps for planting a seed in order.
Drag the items, or use the arrow buttons, to put them in order.
- Make a small hole with your finger
- Water the pot
- Drop the seed in the hole
- Fill a pot with soil
- Cover the seed with soil
Step 3 of 12Learn
The robot sandwich
Imagine a robot named Beep. Beep follows every instruction exactly.
You say: "Put peanut butter on the bread." Beep picks up the whole jar and puts it on top of the bread, lid still on!
You needed more exact steps:
- Open the jar.
- Pick up the knife.
- Scoop peanut butter with the knife.
- Spread it on one slice of bread.
Big jobs are made of many small, exact steps. Breaking a big job into small steps is called decomposition.
Step 4 of 12Practice · Choose one
Beep the robot is told "Put on your coat." What is the most likely problem?
Step 5 of 12Diagram
Exact steps for Beep: put on a coat
Tap a shape with to see more.
- Pick up the coat
- Hold it open
Inside facing you.
- Left arm in
Into the left sleeve.
- Right arm in
Into the right sleeve.
- Zip it up
From the bottom to the top.
Step 6 of 12Compare
Unclear steps vs. exact steps
| Aspect | Unclear | Exact |
|---|---|---|
| Brushing teeth | Brush your teeth | Put a pea-sized blob of toothpaste on the brush, brush for 2 minutes, rinse |
| Walking | Go over there | Walk 5 steps forward, then turn left |
| Baking | Bake it for a while | Bake at 350 degrees for 12 minutes |
Step 7 of 12Practice · Spot the mistake
Tap the step that is in the wrong place in this plan for making toast.
Step 8 of 12Practice · Diagram
The toast plan, fixed
Tap the step that makes the bread start getting hot.
Tap the shape that answers the question, then press Check.
- Take bread out
- Bread in toaster
- Push lever down
Now the toaster heats up.
- Wait for the pop
- Eat the toast
Last, because now it is ready!
Step 9 of 12Practice · Code challenge
This function gives the steps for washing your hands, but two steps are in the wrong order. Move the lines so the steps are: wet hands, add soap, scrub for 20 seconds, rinse, dry.
washHands()
Step 10 of 12Note
Step 11 of 12Practice · Put in order
Put these steps for drawing a smiley face in a good order.
Drag the items, or use the arrow buttons, to put them in order.
- Draw a curved line for a smile under the eyes
- Color the face yellow
- Draw a big circle
- Draw two dots for eyes inside the circle
Step 12 of 12Practice · Fill in the blanks
Fill in the blanks
Steps that happen one after another in a set order are called a .
Lesson complete!