/ p5 / re-code 17

Inspiré par Computer Graphics and Art nov 1976 vol1 n°4 page 28

// This sketch is part of the ReCode Project - http://recodeproject.com
// From Computer Graphics and Art vol1 no4 pg 28
// Untitled 1 (Computer graphics at the University of Munich - West Germany)
// by Various (Reiner Schneeberger and unnamed students)
// 
// Nick Santaniello
// 2012
// Creative Commons license CC BY-SA 3.0

var cols = 10;
var rows = 10;
var offsetX;
var offsetY;
var sqSize= 78;
var sizeDifference = 12;

function setup() {
 createCanvas(780, 780);
 offsetX = random(-6, 6);
 offsetY = random(-6, 6);
 rectMode(CENTER);
 strokeWeight(2);
 fill(240);

 //for every row...
 for (var r = 0; r<rows; r++) {
 //for every column...
 for (var c = 0; c<cols; c++) {
 //choose a new offset
 offsetX = random(-7, 7);
 offsetY = random(-7, 7);
 rect(c*sqSize, r*sqSize, sqSize, sqSize);
 for (var i=1; i<6; i++) {
 rect((c*sqSize)+(i*offsetX), (r*sqSize)+(i*offsetY), sqSize - (i*sizeDifference), sqSize - (i*sizeDifference));
 }
 }
 }
}

function draw() {
}