Using for loops


show more Using for loops provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing show less
please wait ...

Using for loops

One of the most common ways of repeating code within Processing and then almost every other computer language is with something called a for loop, and this is a structure that allows you to specify how often the particular code is to be repeated. I'm going to show you a quick example of how this works in creating a drawing in Processing. I'll begin with comment there. I'm going to import a palette from the palette.txt file that's in the Exercise File. This one, I'll be using this palette right here.

I'm going to copy it, paste it in. I'm also going to create a variable called s for the size of the squares I'm going to be drawing. I'm going to make them 50 pixels on the side. Then I'll do the setup. In the setup I'm going to put the size, 600x200, the background, I'll be putting in, turn on the anti-aliasing and turn off the borders by using no stroke.

So there's the setup. Now normally at this point I would finish the setup and go onto dr...

Using for loops
Video duration: 5m 35s 7h 43m Beginner

Viewers:

Using for loops provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing

Subjects:
Developer IT
Software:
Processing
Author:
please wait ...