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.
⭐
Geometric Art
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!
Finding the Base Unit
To recognize a pattern in code, look for the base unit — the smallest group of blocks that repeats. Once you find it, you can write a loop.
Example: Move 60 → Turn 90° → Move 60 → Turn 90° → Move 60 → Turn 90° → Move 60 → Turn 90°
Base unit: Move 60 → Turn 90° — repeat 4 times. That's a square!
💡
Try This
Move Forward 60 → Turn Right 90° → Change Color. Set Repeat to 12. What do you think it draws? Run it and find out!