Lesson 1: When something happens

Unit overview - Next: Lesson 2

About 45 minutes.

Goal

Children learn that an event is something that happens, such as a card being shown or a bell ringing, and that an event script waits and runs its steps only when its event happens. They trace which script runs for a list of events.

Materials

Steps

Opening (5 min)

  1. Hold up a term 1 style program (a straight list of steps). Ask: "When does the robot do step 1? Step 2?" (Straight away, then one after the other, top to bottom.)
  2. Ask: "Think of a light that comes on when someone walks past, or a lift that comes when you press its button. Does it do things straight away, one after another?" (No. It waits until something happens.)
  3. Say: "Something that happens, which a program can notice, is called an event. Today the class is a program that waits for events."

Main activity (30 min)

Part 1: three event scripts (10 min). Put up three scripts:

WHEN the green circle card is shown:
    CLAP 1 TIME

WHEN the red triangle card is shown:
    TAP DESK 2 TIMES

WHEN the bell rings:
    STAND UP

Read them together. Say: "Each script waits. Its steps run only when its event happens, and every time it happens." Practise: show the green circle (everyone claps once), the red triangle (two taps), then ring the bell while holding up the bell picture (everyone stands; then sit down again).

Part 2: the teacher chooses the order (10 min). Run these event lists. Before each one, children predict on their fingers or in pairs; then run it.

Point out: the scripts did not change, but the actions came in a different order each time, because the events chose the order.

Part 3: a fourth script (10 min). Add, with the class:

WHEN the blue square card is shown:
    REPEAT 3 TIMES:
        TAP DESK

Run List C again (three taps). Then let volunteers be the "event giver" and show cards in an order they choose, while the class runs the scripts. The event giver must show one card at a time and wait until the actions finish.

Discussion questions (with answers) (5 min)

Closing check (with answers) (5 min)

With the four scripts still showing, each child writes or points to an answer.

  1. "I show red, then green. What happens?" (Tap tap, then clap.)
  2. "I ring the bell twice. How many times do you stand up?" (Twice: the script runs every time; sit down in between.)
  3. "I show a yellow card. What happens?" (Nothing; no script for it.)

Vocabulary

event, event script, wait, run

Differentiation

Safety

Teacher notes and misconceptions