Skip to content
Menu

Year 4 (ages 8–9, Grade 3 in the US) · Computing · Loops in Scratch · Lesson 2

Drawing shapes with loops

Drawing regular shapes with repeat loops and pen blocks: number of repeats, the turn of 360 divided by sides, and debugging shape code.

Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

Whiteboard video lesson: Drawing shapes with loops

15-minute video lesson

Teaching, worked examples and 20 practice questions solved step by step.

Watch free for a month

What your child will learn

  • Draw regular shapes with loops
  • Calculate the turn for a shape
  • Predict the shape from code
  • Debug shape programs

The method

  1. Pen down.
  2. Repeat sides.
  3. Move.
  4. Turn 360/n.

Key words: loop, repeat, pen down, turn, regular shape, degrees.

Worked examples

Worked examples from the lesson, with every step.

Question 1

Write a loop to draw a regular pentagon.

  1. Step 1: Pentagon: 5 sides - repeat 5
  2. Step 2: Turn = 360 ÷ 5 = 72°
  3. Step 3: Write the code

Answer: repeat 5 { move 100, turn 72° }

Question 2

Write a loop to draw a regular octagon.

  1. Step 1: Octagon: 8 sides - repeat 8
  2. Step 2: Turn = 360 ÷ 8 = 45°
  3. Step 3: Write the code

Answer: repeat 8 { move 100, turn 45° }

Question 3

What shape does this code draw?

  1. Step 1: Read the code
  2. Step 2: repeat 4 - 4 sides
  3. Step 3: Turn 90° each time (4 × 90 = 360)

Answer: a regular square