Haig Armen Educational Archive


Exercise 30

by Haig. Average Reading Time: less than a minute.

Let’s replace our while loop with a For Loop to see how it works


int ellipseSize = 40;

void setup() {
  size(800, 800);
  smooth();
}

void draw() {
  noFill();
  strokeWeight(.5);
  stroke(255);
  for (int i=0; i <100; i ++) {
    for (int j=0; j <100; j ++) {
    ellipse(i * (ellipseSize/2), j * (ellipseSize/2), ellipseSize, ellipseSize);
  }
  }
}

No comments on ‘Exercise 30’

Leave a Reply