//
// use globally available functions to:

//var i for counting the loops
var i = 1;

//end x and y for end points
var end_x = 1;
var end_y = 1;

//var
var pen = 1;

//make the background white
setBackgroundColor(1, 1, 1);


//loop this by counting the var i
//uses math.random() which outputs randoms between 0-1
//uses math.round() to quantize the grid
do {
end_x = Math.round((math.random()*4)) * .25
end_y = Math.round((math.random()*4)) * .25
pen = math.round((math.random()*4)) * .25

setPenColor(pen+.02, pen+.02, pen+.02);
setPenWeight(pen * .025);

drawLine(i*.01, .5, end_x, end_y);

i = i+1;
} while (i<1000); //loop this to draw 1000 lines



//
// stop playback head to prevent continuous redrawing
//
stop();