Mastering the For-Loop

Simply put, the for-loop is a tool to execute certain lines of code multiple times. This has incredible potential, especially for generative design. Because as soon as a certain action is formulated in code, the computer doesn’t care how often it has to perform this action. For Creative Coding, this means that enormously complex visual worlds become realizable, which would be impossible to implement manually.

In its simplest form and in relation to creative coding, the for-loop is first of all a tool to distribute multiple elements on the canvas. In this course you’ll learn various ways to to so.

Three possible forms of distribution will be used as examples in the first part of this course:

In the second part, we will have a look at nested for-loops and grid-systems. Believe me, this is truly a superpower!

Ready? Let’s get started!

Get started →