Skip to content
Home: Success TutoringTeachers

Grade 3 Computer Science lesson plan Β· More Computer Science resources

Unplugged Algorithms: Program the Teacher

Without any computers, students learn that an algorithm is a precise, ordered set of steps. They 'program' the teacher to draw a shape, write arrow code to move a robot around a grid, and debug algorithms that don't work.

  • 45 minutes
  • Grade 3
  • Computer Science
  • Algorithms
  • πŸ‡ΊπŸ‡Έ United States

By the Success Tutoring Teachers team Β· Updated Β· Educator review in progress Β· How we make our resources

Download PDF

Overview

Learning objectives

Students will…

  • Explain that an algorithm is a precise, ordered set of steps to complete a task.
  • Write and follow algorithms using arrow code on a grid.
  • Find and fix errors (debug) in an algorithm.
  • Use a repeat to make an algorithm shorter.

Success criteria

Students can say…

  • I can write clear, step-by-step instructions that someone else can follow exactly.
  • I can write arrow code to move from one square to another on a grid.
  • I can find the bug in an algorithm and fix it.

Curriculum focus: Computational Thinking Β· State standards (Texas TEKS first)

Specific curriculum codes are added once our team has checked them against the official documents. How we align resources

More Texas teacher resources (TEKS and STAAR)

Key vocabulary

algorithm
A precise set of steps, in order, to solve a problem or complete a task.
sequence
The order in which steps happen.
program
An algorithm written in a form a computer (or robot) can follow.
bug
A mistake in an algorithm or program that stops it from working as planned.
debug
To find and fix a bug.
repeat (loop)
An instruction to do some steps again a set number of times.

In the glossary: algorithm, bug, debugging, program, repetition, sequence

Materials & preparation

You will need

  • Whiteboard and marker for the 'program the teacher' demonstration
  • 5 Γ— 5 grid printed on A4 (one per pair) with columns A–E left to right and rows 1–5 from bottom to top
  • A counter or small toy per pair to act as the robot
  • Arrow cards (↑ ↓ ← β†’) or pencils to draw arrows
  • Optional: masking tape to make a 5 Γ— 5 floor grid
  • The practice sheet and exit ticket (printable)

Before the lesson

  1. Print the grid sheets and the practice sheet.
  2. Draw a large 5 Γ— 5 grid on the board with the same labels as the student grid. Explain the arrow rules: ↑ moves up one square, ↓ down one, β†’ right one, ← left one. The robot does not turn β€” it slides.
  3. Optional: tape a floor grid with squares large enough for a student to step in. Keep it clear of desks and bags to avoid trips.

Lesson sequence

  1. 1

    Hook: program the teacher

    6 min

    Teacher

    • Say: 'I am a robot. I can only do exactly what you tell me. Your job: get me to draw a square on the board.'
    • Follow instructions literally and with humor: if told 'draw a line', draw a tiny wobbly line anywhere; if told 'pick up the marker', hold it without taking the lid off.
    • After a few attempts, ask: 'Why did the robot keep getting it wrong?' (The instructions were not precise enough or were in the wrong order.)
    • Introduce the word algorithm: 'A set of precise steps in the right order.'

    Students

    • Give instructions one at a time.
    • Notice what makes instructions clear or unclear.
  2. 2

    Explicit teaching: arrow code

    9 min

    Teacher

    • Show the board grid. Place the robot at A1 (bottom-left). Explain the four arrows.
    • Model: 'I want the robot to get to C2. I'll write β†’ β†’ ↑.' Trace each step aloud: A1 to B1, B1 to C1, C1 to C2.
    • Introduce repeat: 'Instead of β†’ β†’ β†’ β†’ I can write β†’ Γ—4, which means repeat right 4 times.'
    • Introduce debugging: write ↑ β†’ ↑ β†’ and say 'I wanted to reach C2 but ended at C3. Let's find the bug.' Trace together to find the extra ↑.

    Students

    • Trace arrow code with a finger on their own grid.
    • Call out where the robot lands.
  3. 3

    Guided practice: pair programming

    12 min

    Teacher

    • In pairs: one student is the programmer and secretly chooses a target square, then writes arrow code from A1. The other is the robot and follows the code with a counter. Did they land on the target? Swap roles.
    • Add obstacles: students draw two 'puddles' on their grid that the robot must not step on.
    • Optional: use a floor grid where one student walks the code while another reads it out. Walk only, one square at a time.
    • Circulate and ask: 'Is there a shorter algorithm?' 'Where is the bug?'

    Students

    • Write and test arrow code in pairs.
    • Debug code that doesn't reach the target.
  4. 4

    Independent practice

    12 min

    Teacher

    • Students complete the practice sheet using their grid and counter.
    • Support a small group with a 3 Γ— 3 grid if needed.

    Students

    • Complete the practice sheet.
  5. 5

    Reflect and exit ticket

    6 min

    Teacher

    • Ask: 'Where do you see algorithms in everyday life?' (Recipes, game rules, instructions for building a model, traffic lights.)
    • Students complete the exit ticket individually.

    Students

    • Share an everyday algorithm.
    • Complete the exit ticket.

Worked examples

Writing arrow code

The robot starts at A1. Write arrow code to move it to D3.

  1. Work out how far across: from column A to column D is 3 squares right.
  2. Work out how far up: from row 1 to row 3 is 2 squares up.
  3. Write the steps: β†’ β†’ β†’ ↑ ↑ (or β†’ Γ—3, ↑ Γ—2).
  4. Test it: A1 β†’ B1 β†’ C1 β†’ D1 β†’ D2 β†’ D3. It works.

β†’ β†’ β†’ ↑ ↑ (other orders of 3 rights and 2 ups also work if there are no obstacles).

Debugging an algorithm

Kai wants the robot to go from A1 to C3. He wrote ↑ ↑ β†’ β†’ β†’. Where does the robot end up, and how do you fix it?

  1. Trace step by step: ↑ to A2, ↑ to A3, β†’ to B3, β†’ to C3, β†’ to D3.
  2. The robot ends at D3, one square too far right.
  3. The bug is one extra β†’.
  4. Remove the last arrow: ↑ ↑ β†’ β†’.

The robot ends at D3. Fixed code: ↑ ↑ β†’ β†’.

Practice & answers

Printable student sheet

Arrow Code Practice

Use a 5 Γ— 5 grid: columns A–E go left to right, rows 1–5 go bottom to top. ↑ up one, ↓ down one, β†’ right one, ← left one. 'Γ—3' means repeat 3 times.

  1. 1Start at A1. Follow β†’ β†’ ↑. Where does the robot end?
  2. 2Start at B2. Follow ↑ ↑ β†’ ↓. Where does the robot end?
  3. 3Start at A1. Follow ↑ Γ—4, then β†’ Γ—2. Where does the robot end?
  4. 4Write arrow code to go from A1 to E1.
  5. 5Start at E5. Write arrow code to get to C4.
  6. 6Zara wants to get from A1 to C3 without stepping on a puddle at B2. She wrote β†’ ↑ β†’ ↑. What is the bug? Fix it.
  7. 7Put these steps for planting a seed in order: cover the seed with soil; fill a pot with soil; water the soil; make a small hole; put the seed in the hole.
  8. 8Mei's instruction for drawing a square says: 'Draw a line. Turn. Draw a line. Turn. Draw a line. Turn. Draw a line.' Why might a robot not draw a square? Improve it.
Show answers
  1. C2
  2. C3 (B3, B4, C4, C3)
  3. C5
  4. β†’ β†’ β†’ β†’ (or β†’ Γ—4)
  5. ← ← ↓ (any order of 2 lefts and 1 down)
  6. The robot goes A1 β†’ B1 β†’ B2, which is the puddle. A fix: β†’ β†’ ↑ ↑ (B1, C1, C2, C3), or ↑ ↑ β†’ β†’ (A2, A3, B3, C3).
  7. Fill a pot with soil; make a small hole; put the seed in the hole; cover the seed with soil; water the soil.
  8. It doesn't say how long each line is or which way or how far to turn. Better: 'Repeat 4 times: draw a line 5 cm long, turn right a quarter turn.'

Differentiation

Offer tasks by choice or quietly by invitation β€” avoid labelling groups by ability in front of the class.

Additional support

  • Use a 3 Γ— 3 grid and only β†’ and ↑ arrows at first.
  • Give arrow cards to lay out physically before writing the code.
  • Pair with a partner who reads each step aloud while the other moves the counter.

Core task

  • Complete all practice questions and write one algorithm for a partner to test.

Extension challenge

  • Add turning commands (turn left, turn right, move forward) where the robot faces a direction, and rewrite question 1 using them.
  • Find the shortest code to collect three 'stars' placed on A3, C5 and E2 starting from A1.
  • Write an algorithm with a repeat that draws a staircase pattern on the grid.

Assessment & exit ticket

Formative assessment

  • Observe pair programming: do students trace code step by step to test it?
  • Check debugging answers (questions 6 and 8) for identifying the exact step that causes the error.
  • Use the exit ticket to check understanding of 'algorithm' and 'debug'.

Exit ticket

  1. What is an algorithm?
  2. Start at A1. Follow β†’ ↑ ↑ β†’. Where does the robot end?
  3. What does 'debug' mean?
Show exit ticket answers
  1. A precise set of steps, in order, to complete a task or solve a problem.
  2. C3 (B1, B2, B3, C3)
  3. To find and fix a mistake (bug) in an algorithm or program.

Common misconceptions

  • Computers 'know what you mean'. Computers follow instructions exactly; vague or missing steps cause bugs.
  • Order doesn't matter. In many algorithms the order changes the result (e.g. putting the seed in before making the hole).
  • A bug means the whole algorithm is wrong. Often only one step needs changing. Trace step by step to find it.
  • Left and right from the robot's view. If the robot turns, its left and right may differ from ours. In this lesson the robot slides without turning; introduce turning as an extension.

Extension

  • Write an algorithm for a classroom routine (e.g. packing up) and test it with a partner who follows it exactly.
  • Try the coding game or coding quest to apply sequencing and loops on screen.

Free resources from other Success Tutoring sites that match this topic.

More lesson plans

Need a timer for this lesson? Open the Classroom Timer or make random groups.