Lesson 4: Plan before you run

Unit overview - Previous: Lesson 3: Break it down - Next: Lesson 5: Plan, code, swap and check

Back to the grade 2 year plan

Goal: Children fill in a plan (goal, start, steps, what should happen) before running a floor-grid program, then run it and compare what happened with the plan.

Length: about 30 minutes.

Materials

Steps

Opening (5 min)

"Duck has a letter for Hen. Before the robot moves, programmers make a plan." Fill in the large planning sheet with the class:

"Writing what should happen before we run the program means we can check it afterwards."

Main activity (17 min)

  1. A plan with a bug (5 min). Put the start card on (column 1, row 1) and Hen's house on (column 3, row 3). Write these steps on the board plan: forward, forward, turn left, forward, forward. A volunteer bot holds the letter and the tester shows each card. Stop the bot as soon as a step would take it off the grid. "Did it happen?" (Answer: no. After forward, forward the bot is on (column 1, row 3). Turn left points it off the left edge, so the next forward leaves the grid.) "Which step is different from our plan?" (Turn left.) Change it to turn right and run again. (Answer: forward, forward, turn right, forward, forward ends on (column 3, row 3), Hen's house. Tick "Did it happen?")
  2. Groups plan and run (10 min). Groups of three. Start card on (column 4, row 1), bot facing the back; Hen's house on (column 2, row 4). The group fills in Goal, Start and What should happen first, then lays out the steps, then runs. The tester ticks or crosses "Did it happen?". If it is a cross, they find the first step that went wrong, fix it and run again. Swap badges after each run.

    (One answer: forward, forward, forward, turn left, forward, forward. Other answers that reach Hen's house also count, for example turn left, forward, forward, turn right, forward, forward, forward.) 3. Share (2 min). One group shows its plan and says whether it matched.

Discussion questions (with answers) (4 min)

Closing check (with answers) (4 min)

On the board: Goal "reach the star". Start (column 2, row 1), facing the back. Steps: forward, forward. What should happen: "stops on (column 2, row 3)". Show the star on (column 2, row 3). Children show tick or cross for "Will it happen?" (Answer: tick. Two forwards from row 1 reach row 3.)

Vocabulary

Differentiation

Safety

Teacher notes