> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.GXFPvhgZ74Y/rev.194
 * 
 * authors: 
 *   Eric Fickes

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "grid", created by Eric Fickes
// http://studio.sketchpad.cc/sp/pad/view/ro.93iWhOOTRuPVU/rev.305



// Pressing Control-R will render this sketch.

int i = 0; 

int ct, maxCt;
int shapeSize = 95;
int gridSize = 100;
float x,y;

void setup() {  // this is run once.   
    
    // set the background color
    background(255);
    
    // canvas size (Variable aren't evaluated. Integers only, please.)
    size(600, 600); 
      
    noFill();
    smooth();
    
    // scan lines
    stroke(111,20);
    for( float xx = 0; xx < (width+height); xx+=2) {
        strokeWeight( random(.99) );
        line( 0, xx, width, xx );
        line( xx, 0, xx, height);
    }
    

    stroke(0);
    maxCt = width+height;
} 

void draw() {  // this is run repeatedly.  

    // set the width of the line. 
    strokeWeight( random(.5, 1.5) );

    ellipse( x, y, shapeSize, shapeSize );
    
    if( x > width && y > height) {
        x = -gridSize;
        y = -gridSize;
        
        shapeSize *= ( (shapeSize/gridSize) )+.1;
        
    } else if( x > width ) {
        x = -gridSize;
        y += gridSize;
    } else {
        x += gridSize;
    }

    if( ct > maxCt ) {
        noLoop();
    } else {
        ct++;
    }

}