> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.qBu-5s91KzF/rev.1141
 * 
 * authors: 
 *   The Serendipitous Cacophonies

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




void setup()
{
  size(300, 300);
  background(128);
  stroke(0);
  smooth();
}

void draw() {
    tile_size = 50;
    for (i=0; i<=300; i+=tile_size) {
        for(j=0; j<=300; j+=tile_size) {
            if (mousePressed && (mouseButton == LEFT)) {      
                stroke(frameCount % 255, frameCount % 128, frameCount % 64);
                translate(i, j);
                line(pmouseX, pmouseY, mouseX, mouseY);
                line(pmouseY, pmouseX, mouseY, mouseX);
                line(-pmouseX, -pmouseY, -mouseX, -mouseY);
                line(-pmouseY, -pmouseX, -mouseY, -mouseX);
                translate(-i, -j);
            }
            if (mousePressed && (mouseButton == RIGHT)) {      
                stroke(128);
                translate(i, j);
                line(pmouseX, pmouseY, mouseX, mouseY);
                line(pmouseY, pmouseX, mouseY, mouseX);
                line(-pmouseX, -pmouseY, -mouseX, -mouseY);
                line(-pmouseY, -pmouseX, -mouseY, -mouseX);
                translate(-i, -j);
            }
        }
    }
}