a port of the Processing Visualization Language


by Ira Greenberg. Using 2 random() calls the and point() function to create an irregular sawtooth line.

Original Processing.org Example: DoubleRandom

// All Examples Written by Casey Reas and Ben Fry

// unless otherwise stated.

size(200, 200);


int totalPts = 300;

float steps = totalPts+1;


float rand = 0;

for  (int i=1; i< steps; i++){

  point( (width/steps) * i, (height/2) + random(-rand, rand) );

  rand += random(-5, 5);

Fork me on GitHub