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.

15-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat 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
- Pen down.
- Repeat sides.
- Move.
- 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.
- Step 1: Pentagon: 5 sides - repeat 5
- Step 2: Turn = 360 ÷ 5 = 72°
- Step 3: Write the code
Answer: repeat 5 { move 100, turn 72° }
Question 2
Write a loop to draw a regular octagon.
- Step 1: Octagon: 8 sides - repeat 8
- Step 2: Turn = 360 ÷ 8 = 45°
- Step 3: Write the code
Answer: repeat 8 { move 100, turn 45° }
Question 3
What shape does this code draw?
- Step 1: Read the code
- Step 2: repeat 4 - 4 sides
- Step 3: Turn 90° each time (4 × 90 = 360)
Answer: a regular square