/ Published in: Processing

Simple example demonstrating nested for loops, colors, shapes, fill, stroke/no stroke, canvas size and smooth.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
void setup() { size(400, 400); background(0); smooth(); stroke(255, 50); //noStroke(); } void draw() { for(int i = 0; i < width; i+=50) { for(int j = 0; j < height; j+=50) { fill(100, 0, 150, 100); ellipse(25 + i, 25 + j, 50, 50); fill(20, 100, 0, 50); rect(i, j, 50, 50); println("i = " + i + " j = " + j); } } }
Comments
