Repetitive Pattern with for Loops

For this exercise, I wanted to recreate a pattern inspired by a textile-like image made of repeated colored squares and sticky note board.

Building the Background Grid

The first step was to create the colored background. I used a nested for loop because I needed to repeat squares both horizontally and vertically.

To decide which color each square should have, I first calculated its row and column.

Screenshot 2026-09-29 at 19.47.19.png

Adding the Sticky notes with shadow

After finishing the background, I used another pair of nested for loops:

Screenshot 2026-09-29 at 19.51.36.png

Adding the Pins

For the final layer, I added small yellow circles to the corner of each cream square. I used the same loop positions as the cream squares, so every pin automatically matches one square.

Screenshot 2026-09-29 at 19.53.24.png

What I Learned

The most useful part of this exercise was realizing that a complicated-looking pattern can often be broken into a small number of repeated rules. Instead of thinking about the image as hundreds of individual squares, I started thinking about it as different layers.