Choose a country
Grade 5Computer scienceAlgorithms and programs

Programs and the Turtle

Lesson goal: Know that a program is a sequence of commands for a performer, draw shapes with Turtle commands and use the repeat command.
← Algorithms and programs

About this lesson

A program is an algorithm written in a language the performer understands. A performer only follows its own command set. The Turtle moves on the screen and leaves a trail. Main commands: forward N, back N, right N (turn N degrees), left N, pen up / pen down (move without or with a trail). A square needs “forward 100, right 90” four times. Shorter: repeat 4 [forward 100 right 90]. An equilateral triangle: repeat 3 [forward 100 right 120]. Rule: a full turn is 360 degrees, so divide 360 by the number of sides.

Lesson goal: Know that a program is a sequence of commands for a performer, draw shapes with Turtle commands and use the repeat command.

What the book shows

In grade 5 the computer science textbook has units on information, the computer, applications, algorithms and the internet. Each topic gives a short explanation, an example and a task done on or off the computer.

Textbook link:

This is not the textbook’s text but a short description of the topic. Check the exact page in your own textbook.

The lesson step by step

  1. 1

    Warm-up5 min

    Robot game: walking by commands.

  2. 2

    New topic10 min

    Program and performer.

  3. 3

    Practice10 min

    Turtle commands.

  4. 4

    Game10 min

    The repeat command.

  5. 5

    Wrap-up5 min

    Drawing polygons.

Let’s understand

For the student Simple language

ShapeProgram
squarerepeat 4 [forward 100 right 90]
trianglerepeat 3 [forward 100 right 120]
hexagonrepeat 6 [forward 60 right 60]
turn angle = 360 ÷ number of sides

Going deeper

Scientific language: for older students, parents and teachers.

Turtle programming comes from the Logo language, created in the 1960s to teach children programming.

Play and check

Which shape does it draw?

How to write it down

  1. Write programs for a square, a triangle and a pentagon.
  2. Draw the Turtle’s path on squared paper.

How the classwork looks in the notebook

15 November1Classwork2repeat 4 [forward 100 right 90] · angle = 360 ÷ N3
Writing order: 1 Date 2 Heading 3 Line 3: repeat 4 [forward 100 right 90] · angle = 360 ÷ N
Sample: the date and heading follow this country’s notebook rules.

Open notebook

Watch out: common mistakes

Turning 60 degrees for a triangle. The Turtle turns by the outside angle: 360 ÷ 3 = 120.
Forgetting pen down. No trail means the pen is up.

Where it helps in life

  • Searching the internet

At home

Core

  1. Write a program for a pentagon.

Extra ⭐

  1. Plan a program that draws two squares side by side (using pen up).

How to do it

  1. Do the task with a grown-up.
  2. Explain in words what you noticed.
Answers for parents

Pentagon: repeat 5 [forward 80 right 72] (360 ÷ 5 = 72). Two squares: repeat 4 [forward 50 right 90], pen up, right 90, forward 70, left 90, pen down, repeat 4 [forward 50 right 90].

Step-by-step homework solution — Show the solution (try it yourself first)
  1. Think

    1. repeat N [forward a right 360÷N] draws any regular polygon; as N grows, the shape looks more and more like a circle.

How the homework looks in the notebook

15 November1Homework2Turtle3
Writing order: 1 Date 2 Heading 3 Line 3: Turtle
Sample: the date and heading follow this country’s notebook rules.

Check yourself