Loops & Patterns
Do a lot with a little. Tell the computer one move, then say how many times to repeat it.
One move, said many times
Imagine you are holding a pen on a big sheet. To draw a square you do the same thing four times: move forward a bit, then turn. A is how you tell a computer to repeat a move without writing it out over and over.
# the long way: typing every line move forward turn 90 degrees move forward turn 90 degrees move forward turn 90 degrees move forward turn 90 degrees # the loop way: same picture, way less to write repeat 4 times: move forward turn 90 degrees
A loop repeats instructions. Both versions above draw the exact same square. The loop just says it once and tells the computer how many times to go around.
Draw with a loop
Set how many times to repeat and how far to turn each time. Press Run and the pen draws your loop. Change a number and the shape changes too.
Ready
Repeat count
5
How many times the loop goes around. More turns make more sides.
Turn angle
72°
How far the pen turns after each move. A small change here makes a very different pattern.
Small change, big difference. Leave the count alone and just nudge the angle. The same short loop can draw a tidy shape, a pointy star, or a tight coil. That is the power of a loop: one rule, endless patterns.
← The Foundry · every fact here is real. Tap the underlined words to dig deeper.