Week 3
Giving Exact Instructions
Turn a path into a clear step-by-step plan, then program the robot to follow it exactly.
- 60-75 minutes
- Mission: Plan an exact sequence of move and turn commands, predict where it ends, then program the robot to follow a path to a goal.
Students learn that computers follow instructions literally and exactly: a robot does what you actually told it, not what you meant. They write an algorithm - a clear step-by-step plan - as pseudocode in plain language, then turn it into a program made of a straight sequence of movement commands with timing, distance, and turns. They predict where the robot will end up before running, then run and compare. This is a sequences-only week: no loops, conditions, or sensors yet - just exact, ordered commands to steer a robot through a delivery path or maze to a goal.
By the end of this week you can
- Explain that a program is a sequence of commands a computer follows in order, literally and exactly
- Write an algorithm as pseudocode - a clear step-by-step plan in plain language - before coding
- Control a robot's path using distance, timing, and turn commands in the right order
- Predict where a robot will end up before running the program, then check the prediction
- Program the robot to follow a delivery path or maze to a goal using only a sequence of commands
Learn
Computers follow instructions literally
A robot does exactly what you tell it - not what you meant. If you say 'go forward' but forget to say how far, the robot cannot guess; it does the wrong thing or nothing at all. Computers are fast and tireless, but they have no common sense.
This is the most important idea this week. When a robot misbehaves, it is almost always following your instructions correctly - your instructions just weren't what you wanted.
For example: 'Make a sandwich' fails if you don't say 'open the bread bag first'; A robot told to 'turn' but not how far spins the wrong amount; 'Go to the door' means nothing to a robot - it needs 'forward 3 squares, turn left'
A program is a sequence of commands
A program is a list of commands the robot runs one after another, from top to bottom. Each command is one small instruction, like 'move forward' or 'turn right'. Running them in order is called a sequence.
Order matters. 'Turn right, then move forward' sends the robot somewhere completely different from 'move forward, then turn right', even though the commands are the same.
For example: move forward 2 squares -> turn right -> move forward 1 square; Swapping two commands changes where the robot ends up
Events start a program
A program doesn't run until something starts it. That starting moment is called an event - like pressing a 'Start' button, tapping a 'when tapped' block, or clicking Run in the simulator.
This week every program has one event at the top that kicks off the sequence, and then the commands run straight through in order.
For example: 'When Start is pressed' at the top of the program; Clicking Run in the simulator; Tapping the go button on the kit app
Algorithms and pseudocode: plan before you code
An algorithm is a clear step-by-step plan for a task, with every step spelled out and nothing left fuzzy. Before writing real code, engineers write the plan in plain language first - that plain-language plan is called pseudocode.
Pseudocode lets you think through the path without fighting the blocks yet. You might write 'forward 3, turn left, forward 2, stop', check that it makes sense, and only then build it as commands.
For example: Pseudocode: 'forward 3 squares, turn left 90, forward 2 squares, stop'; An algorithm has no missing steps and no 'you know what I mean' gaps
Controlling distance with timing, speed, and turns
This week you steer the robot with three tools: how far it moves (distance), how long a move runs (timing), and how much it rotates (turns). On many kits, distance comes from timing and speed together - a faster speed for a longer time covers more ground.
Turns rotate the robot in place, usually by degrees. A 90-degree turn is a quarter turn - a right angle - which lines the robot up with the next part of the path. Getting the turn amount right is what keeps the robot on course.
For example: forward at speed 50 for 2 seconds; turn right 90 degrees to face the next hallway; half turn = 180 degrees to go back the way you came
Predict before you run
Before running a program, make a prediction: trace the sequence with your finger and mark where you think the robot will stop and which way it will face. Committing to a guess first makes it obvious when a step is wrong.
Then run it and compare. If the robot ends up somewhere else, the difference tells you exactly which command to fix - maybe a turn was 90 when it needed 180, or a forward was one square too short.
For example: Predict: 'ends on the star, facing up'; If it stops one square early, a distance command is too small
Words to know
- Program:
- A list of instructions a computer follows to do a job. This week, a program is a sequence of movement commands.
- Command:
- One single instruction the robot can carry out, like 'move forward' or 'turn right'.
- Sequence:
- Commands run one after another, in order, from top to bottom. Order matters.
- Algorithm:
- A clear step-by-step plan for doing a task, with no missing or fuzzy steps.
- Pseudocode:
- Writing the steps of a plan in plain language before you turn them into real code.
- Event:
- The moment that starts a program running, like pressing 'Start' or a 'when tapped' block.
- Timing:
- How long a command runs, measured in seconds - one way to control how far the robot goes.
- Distance:
- How far the robot moves in a command, often set in centimeters or grid squares.
- Turn:
- A command that rotates the robot in place, usually by a set number of degrees like 90.
- Speed:
- How fast the motors run. Faster speed covers more distance in the same amount of time.
- Prediction:
- Your best guess about where the robot will end up, made before you run the program.
Stay safe
Read these before you build or run a robot this week.
- Caution:Keep fingers, hair, and loose clothing away from the wheels while the robot drives its program.
- Caution:Clear the floor path of feet, bags, and chair legs before running so the robot has a safe route.
- Note:Walk slowly on the floor grid when acting as the robot so no one trips.
- Note:Take a short screen break if your eyes get tired using the simulator.
Do it
Choose your path
Do this course with a robot kit, the browser simulator, or unplugged with household materials. Pick one - you can switch anytime without losing your work.
Delivery path programming challenge
Robot kitProgram the robot to follow a path or maze from start to goal using only a sequence of exact move and turn commands.
- Look at the map and find the start, the goal, and the walls or turns along the path. Trace the route with your finger first.
- Write the plan as pseudocode in plain language - forwards, turns, and distances in order - before you build anything. Keep it a straight sequence: no loops, no if-checks, no sensors this week.
- Turn the pseudocode into commands, run it, and fix the exact command that was wrong if the robot misses the goal.
Drive the delivery path with your kit robot
You need: w3-m5, w3-m6, w3-m1, w3-m2
Steps
- 1Tape a path on the floor with a start square, a goal square, and one or two turns. Put the small object at the start as the delivery.
- 2Trace the route and write pseudocode: for example 'forward 40 cm, turn right 90, forward 20 cm, stop'.
- 3Measure or time one forward move to learn how far the robot goes, then fill in real distances or times.
- 4Build the sequence of commands in the app, press Start (the event), and watch the robot follow the path.
- 5If it misses the goal, change only the command that was off - a turn amount or a forward distance - and run again.
What success looks like: The robot follows the sequence from start to goal and stops on the goal square with the delivery.
- Pseudocode was written before coding
- Program is a straight sequence of move/turn commands
- The robot reaches the goal and stops there
Safety: Keep fingers, hair, and loose clothing away from the wheels while the robot drives. Clear the path area so the robot won't run into feet or table legs.
If it doesn't work
- The robot overshoots or stops short of the goal
- - Adjust the distance or the timing on that forward command; a small change in seconds moves it a lot.
- The robot turns too far or not far enough
- - Check the turn's degrees - try 90 for a quarter turn - and confirm left vs right.
Go further: Add a second delivery: extend the sequence so the robot goes on to a second goal square after the first.
Predict-then-test the ending
Robot kitPredict where the robot will stop and which way it will face before running a given sequence, then run it and compare.
- Take a short sequence of commands and trace it by hand on the map. Mark on paper where you think the robot ends and which way it faces.
- Commit to your prediction before running anything - write it down first.
- Run the program, compare the real ending to your prediction, and explain any difference by naming the command that caused it.
Predict your kit robot's stopping spot
You need: w3-m5, w3-m1, w3-m3
Steps
- 1Take a 4-to-6 command sequence (yours or a given one) and trace it on the taped path.
- 2On the record sheet, mark the square you predict the robot stops on and the direction it faces.
- 3Run the sequence and mark where the robot actually stops.
- 4Compare: if it differs, point to the command (a turn or a distance) that explains the gap.
What success looks like: A written prediction next to the real stopping spot, with a reason for any difference.
- Prediction was written before running
- Real ending was recorded
- Any difference is explained by a named command
Safety: Stay clear of the wheels while the robot runs its prediction test.
If it doesn't work
- Prediction and result are far apart every time
- - Re-measure how far one forward command really moves the robot; your distance estimate is off.
Go further: Predict the ending for a sequence with three turns in it.
Program the robot
Build a program from blocks, then run it on the simulator. On the kit path, use the same steps in your robot's app; unplugged, act the blocks out on a floor grid. Your program saves on this device.
Delivery path sequence
A straight sequence of move and turn commands that drives the robot from the start to the goal square. Sequence only - no loops, conditions, or sensors.
Add a block
Events & execution
Movement
Variables & counters
Your program
- Move
- Robot (arrow points where it faces)
- Goal zone (dashed outline)
Map: A 5 by 1 grid. The robot starts at column 1, row 1, facing right. The goal zone is at column 5, row 1.
Ready.
Ready to run. · 0 steps
Robot state
- Column
- 1
- Row
- 1
- Facing
- right
- Distance ahead
- 4 cells
- Touch
- clear
- On a line
- no
- Light
- 80
- In goal zone
- no
- Collisions
- 0
- Steps
- 0
Robot at column 1, row 1, facing right. Distance ahead: 4 cells. Touch: clear. Over a line: no. Light: 80. Not in the goal zone.
Log output
Nothing logged yet.
- Heads up: This program has no safe stop behavior. Add a safe stop so the robot stops when it is done or blocked.
Maze sequence challenge
Plan an ordered sequence of move and turn commands that steers the robot around the wall to the goal, then stops. Predict the ending before you run it. Sequence only - no loops, conditions, or sensors.
Add a block
Events & execution
Movement
Variables & counters
Your program
- Move
- Robot (arrow points where it faces)
- Goal zone (dashed outline)
- Wall (grey, X mark)
Map: A 3 by 3 grid. The robot starts at column 1, row 1, facing right. The goal zone is at column 3, row 3. There is 1 wall.
Ready.
Ready to run. · 0 steps
Robot state
- Column
- 1
- Row
- 1
- Facing
- right
- Distance ahead
- 0 cells
- Touch
- pressed
- On a line
- no
- Light
- 80
- In goal zone
- no
- Collisions
- 0
- Steps
- 0
Robot at column 1, row 1, facing right. Distance ahead: 0 cells. Touch: pressed. Over a line: no. Light: 80. Not in the goal zone.
Log output
Nothing logged yet.
- Heads up: This program has no safe stop behavior. Add a safe stop so the robot stops when it is done or blocked.
Predict
Commit to a guess before you test - then see how close you were. Your predictions save automatically.
How to check: Run the sequence and mark the real stopping square and direction, then compare to your prediction on the record sheet.
How to check: Count the commands in your finished, working sequence and compare to your guess.
Test & improve
Predict-vs-actual ending record
For each attempt, write your predicted ending square before running, then run the sequence and record where the robot actually ended. Note which command you changed for the next attempt.
Measure: The predicted end position versus the actual end position across attempts
| Attempt | Predicted end square | Actual end square | Command changed for next try |
|---|---|---|---|
Knowledge check
Answer these to check that you understand sequences, algorithms, pseudocode, and controlling the robot's path.
1. Put these steps in the right order for programming the robot to do a task.
Use the arrows to put these in order.
- 1Write the steps as exact commands
- 2Run the program on the robot
- 3Check whether it did what you expected
- 4Plan the steps as an algorithm
2. The robot starts facing up. Trace this program. Which way is it facing at the end?
turn right turn right turn left
3. Your robot did the wrong thing even though it ran your whole program. What most likely happened?
4. What is a sequence?
5. What is pseudocode?
6. Your robot reaches the right spot but is facing the wrong way. Which command should you check?
7. On a kit that uses timing, how could you make the robot travel farther in one forward command?
0 of 7 answered
Reflect
Your reflections save automatically.
Coming up next week
Next week the robot gets senses - we add a sensor so it can notice the world instead of just running a fixed sequence.
- Keep your best delivery pseudocode; you'll compare a fixed sequence to a robot that reacts.
- Charge your kit or bookmark the simulator, and find your sensor parts if you're on the kit path.
- Think about a time a fixed set of steps failed because something in the way changed.
Finish Week 3
Complete these to mark the week done and unlock the next one:
- Write pseudocode for your delivery path before coding (not done yet)
- Program a sequence that reaches the goal (not done yet)
- Predict an ending and record predicted vs actual (not done yet)
- Score at least 4 of 5 on the knowledge check (not done yet)
- Write your reflection (not done yet)