Creative Coding
Lesson 2 of 3 6 min +40 XP

Patterns with Loops

Repeat shapes to build designs.

What you'll learn

  • Understand patterns with loops
  • Apply it to real examples
  • Check yourself with a quiz
A grid from one instruction

Writing a loop, you say 'draw a dot, move over, repeat 100 times' — and a whole grid appears. Loops turn one instruction into rich, repeating patterns.

Repetition by code

A loop repeats drawing commands. Nested loops make grids; adding randomness gives organic variation.

Knowledge Check

+10 XP / correct

1. A loop in creative coding is used to…

2. Randomness in art code adds…