Patterns & Repetition 🎨
What You'll Learn
- How to identify and create repeating patterns
- How colors make programs more creative and expressive
- How to combine all your blocks to create geometric art
Patterns Are Everywhere
A pattern is something that repeats in a predictable way. Patterns appear everywhere — in nature, in music, in math, and in code.
- A zebra's stripes: black, white, black, white…
- A musical rhythm: boom, boom, clap, boom, boom, clap…
- Multiplication tables: 3, 6, 9, 12, 15…
In code, patterns are powerful because loops let you repeat them automatically. A simple 3-block pattern looped 30 times can create something that looks incredibly complex.
Artists like M.C. Escher built entire careers creating art from repeating geometric patterns. Many of the most famous patterns in math and art can be recreated with just a handful of loops and turns!
Adding Color
Today you have a new block: 🎨 Change Color. Each time this block runs, the turtle's pen switches to the next color in the sequence:
🟢 🔵 🟡 🔴 🩷 🟣 🟩 🟠
Place it anywhere in your program to switch colors mid-drawing. Inside a loop, it changes color every repetition — creating rainbow patterns automatically!
Program: Move Forward 60 → Turn Right 90° → Change Color. Set Repeat to 12. What do you think it draws? Run it and find out!
Triangles with 120° Turns
Today you also unlock two new turn blocks: Turn Left 120° and Turn Right 120°.
Remember the geometry rule: any closed shape totals 360° of turning. A triangle has 3 corners, so each turn must be 360° ÷ 3 = 120°.
- Program: Move Forward 80 → Turn Right 120°
- Repeat: 3
- Result: a perfect equilateral triangle!
Part 1: Draw a triangle using the 120° turn blocks and Repeat 3.
Part 2: Add Change Color to your triangle program and set Repeat to 9. What pattern emerges?
Part 3: Mix squares and triangles. Use Pen Up to reposition between shapes. Create something you would hang on a wall!
1. How many degrees do you turn at each corner of an equilateral triangle?
2. What does the Change Color block do when placed inside a repeated program?
3. What is a pattern?