Pliro – Code play. Build tomorrow.
Menu
Teaching materials and Classroom

PLIRO / Teaching material

A first programming lesson for ages 8–10

Four moves and four turns make a square. Ask learners to predict, run the code and change one number. You can start this lesson without being a programming expert.

Ages 8–10 · Dutch primary groups 5–6Suggested time: 45 minutesFree · No account needed
Start the working example

What you will practise

  • Read a sequence of instructions in order.
  • Identify the two instructions repeated four times.
  • Predict and explain what changing one number does.

What you need

  • A computer, Chromebook or tablet per learner or pair, with internet and an up-to-date browser.
  • Paper and a pencil for drawing the route first.
  • A shared screen is useful for the whole-class introduction.

Preparation

  • Open the example below on a learner’s device and run it.
  • Try changing distance = 60 to distance = 90 yourself.
  • Agree who types and who predicts, then swap roles later.

Teaching material

Step by step

  1. Predict the route · 5 minutes

    Read the four moves and the 90-degree turn. Ask learners to draw where they expect the turtle to finish.

  2. Open and run · 5 minutes

    Open the project below and press Run. Compare the drawing with the prediction. ‘Square finished!’ appears in Output.

  3. Read the loop · 10 minutes

    Discuss how forward and right run for each number in [1, 2, 3, 4]. The indented lines belong together.

  4. Change one value · 15 minutes

    Choose Code, then Text. Change only distance = 60 to distance = 90. Predict what will change, press Run and compare. Then choose a distance between 30 and 100.

  5. Explain a choice · 10 minutes

    Ask each pair what they changed, expected and saw. Invite one learner to point to the line that controls the size.

Try it yourself

This starting code works. Open the project, choose Code, then Text, to change something, then press Run.

A first programming lesson for ages 8–10
# language: en

let distance = 60

for side in [1, 2, 3, 4]:
    forward distance
    right 90

say "Square finished!"

The example result

A closed square. With distance 90, all four sides are longer than with distance 60; the shape is still a square.

Discuss what you discovered

Invite learners to complete ‘I changed … because … and I saw …’. Use their answer to choose the next task.

PDF

Extra material for this lesson

Teacher guide (PDF, in Dutch)

A next step

Continue with patterns and geometry

Continue with patterns and geometry