Exercise 34

size(500,100);
background(255);
strokeWeight(5);
smooth();

int step = 10;
float lastX = -999;
float lastY = -999;

float y = 50;
int borderX = 20;
int borderY = 20;
for( int x = borderX; x <=width-borderX; x +=step) {
  y = borderY + random(height - 2 * borderY);
  if (lastX > -999) {
    line(x, y, lastX, lastY);
  }
  lastX = x;
  lastY = y;
}

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *