# Recreating Generative Art

I decided to recreate the cover from August 1977 called ‘Random Squares’ by Bill Kolomyjec:

My recreation:

I made my recreation using line(), A LOT of rect(), translate() and push/popMatrix(). I feel like there most definitely must be an easier way to create this but (knowing my lack of programming skills) this was the method I chose to go through. I also decided to play around a little with what we learned in class with keyPressed(), and the different functions associated with float, and I definitely did not get what I wanted to achieve but I liked my ‘happy accident’ anyway and I was pretty proud of it.

```int w = 100;
float speed = .01;
float granulation = .001;

void setup() {
size(420, 300);
background(255);
}

void draw(){

// if(keyPressed == true) {
//   fill(153, 165, 194); //199, 32, 32
// } else {
//   fill(190, 191, 194); // 222, 116, 36
// }
//for (int i=0; i<width; i+=w){
// float frequency = (frameCount*speed) + (i*granulation);
// float angle = map(noise(frequency), 0, 1, 0, TWO_PI);
// pushMatrix();

// translate(i+w/2, height*.5);
// rotate(angle);
// rect(0,0, w, 100);
// popMatrix();

line(60, 0, 60, 300);
line(120, 0, 120, 300);
line(180, 0, 180, 300);
line(240, 0, 240, 300);
line(300, 0, 300, 300);
line(360, 0, 360, 300);

line(0, 60, 420, 60);
line(0, 120, 420, 120);
line(0, 180, 420, 180);
line(0, 240, 420, 240);
line(0, 300, 420, 300);
line(0, 360, 420, 360);

///////LINE 1\\\\\\\\\

// CUBE 1,1
pushMatrix();
translate(0, 0);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(15, 14, 30, 30);
rect(19, 18, 20, 20);
rect(25, 24, 10, 10);

popMatrix();

// CUBE 1,2
pushMatrix();
translate(60, 0);

rect(4, 4, 50, 50);
rect(10, 9, 40, 40);
rect(13, 11, 35, 35);
rect(16, 14, 30, 30);
rect(22, 17, 20, 20);
rect(28, 21, 10, 10);

popMatrix();

// CUBE 1,3 DONE
pushMatrix();
translate(120, 0);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 17, 25, 25);
rect(19, 20, 20, 20);
rect(21, 23, 15, 15);
rect(23, 26, 10, 10);

popMatrix();

// CUBE 1,4
pushMatrix();
translate(180, 0);

rect(4, 4, 50, 50);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

// CUBE 1,5
pushMatrix();
translate(240, 0);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

// CUBE 1,6
pushMatrix();
translate(300, 0);

rect(5, 4, 50, 50);
rect(15, 15, 30, 30);
rect(28, 27, 10, 10);
popMatrix();

// CUBE 1,7
pushMatrix();
translate(360, 0);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

/////////LINE 2\\\\\\\\\\\

//CUBE 2,1 DONE
pushMatrix();
translate(0, 60);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

//CUBE 2,2 DONE
pushMatrix();
translate(60, 60);

rect(13, 15, 10, 10);
popMatrix();

//CUBE 2,3 DONE
pushMatrix();
translate(120, 60);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 15, 25, 25);
rect(20, 18, 20, 20);
rect(23, 20, 15, 15);
rect(26, 22, 10, 10);
popMatrix();

//CUBE 2,4 DONE
pushMatrix();
translate(180, 60);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(14, 14, 30, 30);
rect(18, 18, 20, 20);
rect(24, 24, 10, 10);
popMatrix();

//CUBE 2,5 DONE
pushMatrix();
translate(240, 60);

rect(15, 15, 10, 10);
popMatrix();

//CUBE 2,6 DONE
pushMatrix();
translate(300, 60);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 17, 25, 25);
rect(19, 20, 20, 20);
rect(21, 23, 15, 15);
rect(23, 26, 10, 10);
popMatrix();

//CUBE 2,7 DONE
pushMatrix();
translate(360, 60);

rect(1, 2, 55, 55);
rect(3, 4, 50, 50);
rect(5, 7, 45, 45);
rect(7, 9, 40, 40);
rect(10, 11, 35, 35);
rect(12, 12, 30, 30);
rect(14, 15, 25, 25);
rect(15, 17, 20, 20);
rect(18, 20, 15, 15);
rect(20, 22, 10, 10);
popMatrix();

////////////LINE 3\\\\\\\\\\

// CUBE 3,1
pushMatrix();
translate(0, 120);

rect(3, 3, 50, 50);
rect(8, 8, 40, 40);
rect(11, 11, 30, 30);
rect(15, 15, 20, 20);
rect(18, 18, 10, 10);
popMatrix();

// CUBE 3,2
pushMatrix();
translate(60, 120);

rect(7, 7, 50, 50);
rect(12, 12, 40, 40);
rect(18, 18, 30, 30);
rect(23, 23, 20, 20);
rect(29, 29, 10, 10);
popMatrix();

// CUBE 3,3
pushMatrix();
translate(120, 120);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

// CUBE 3,4
pushMatrix();
translate(180, 120);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 17, 25, 25);
rect(19, 20, 20, 20);
rect(21, 23, 15, 15);
rect(23, 26, 10, 10);
popMatrix();

// CUBE 3,5
pushMatrix();
translate(240, 120);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

// CUBE 3,6
pushMatrix();
translate(300, 120);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(16, 17, 25, 25);
rect(18, 20, 20, 20);
rect(19, 23, 15, 15);
rect(21, 26, 10, 10);
popMatrix();

// CUBE 3,7
pushMatrix();
translate(360, 120);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(18, 18, 25, 25);
rect(20, 21, 20, 20);
rect(23, 25, 15, 15);
rect(26, 28, 10, 10);
popMatrix();

/////////LINE 4\\\\\\\\\\\

//CUBE 4,1 DONE
pushMatrix();
translate(0, 180);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

//CUBE 4,2 DONE
pushMatrix();
translate(60, 180);

rect(30, 15, 10, 10);
popMatrix();

//CUBE 4,3
pushMatrix();
translate(120, 180);

rect(4, 4, 50, 50);
rect(7, 7, 40, 40);
rect(11, 12, 30, 30);
rect(15, 17, 20, 20);
rect(20, 23, 10, 10);
popMatrix();

//CUBE 4,4
pushMatrix();
translate(180, 180);

rect(6, 4, 50, 50);
rect(15, 13, 30, 30);
rect(23, 22, 10, 10);
popMatrix();

//CUBE 4,5  DONE
pushMatrix();
translate(240, 180);

rect(10, 10, 37, 37);
rect(23, 23, 10, 10);

popMatrix();

//CUBE 4,6
pushMatrix();
translate(300, 180);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 17, 25, 25);
rect(19, 19, 20, 20);
rect(21, 21, 15, 15);
rect(24, 23, 10, 10);
popMatrix();

//CUBE 4,7 DONE
pushMatrix();
translate(360, 180);

rect(6, 4, 50, 50);
rect(15, 13, 30, 30);
rect(28, 24, 10, 10);
popMatrix();

///////LINE 5\\\\\\\\

//CUBE 5,1
pushMatrix();
translate(0, 240);

rect(4, 4, 50, 50);
rect(13, 13, 30, 30);
rect(20, 20, 10, 10);
popMatrix();

//CUBE 5,2 DONE
pushMatrix();
translate(60, 240);

rect(8, 8, 37, 37);
rect(15, 18, 10, 10);
popMatrix();

//CUBE 5,3 DONE
pushMatrix();
translate(120, 240);

rect(30, 27, 10, 10);
popMatrix();

//CUBE 5,4
pushMatrix();
translate(180, 240);

rect(4, 4, 50, 50);
rect(9, 9, 40, 40);
rect(13, 13, 30, 30);
rect(17, 17, 20, 20);
rect(21, 21, 10, 10);
popMatrix();

//CUBE 5,5
pushMatrix();
translate(240, 240);

rect(2, 2, 55, 55);
rect(4, 4, 50, 50);
rect(7, 7, 45, 45);
rect(9, 9, 40, 40);
rect(12, 12, 35, 35);
rect(15, 14, 30, 30);
rect(17, 17, 25, 25);
rect(19, 20, 20, 20);
rect(21, 23, 15, 15);
rect(23, 26, 10, 10);
popMatrix();

//CUBE 5,6
pushMatrix();
translate(300, 240);

rect(6, 4, 50, 50);
rect(15, 13, 30, 30);
rect(28, 22, 10, 10);
popMatrix();

//CUBE 5,7
pushMatrix();

translate(360, 240);

rect(1, 2, 55, 55);
rect(3, 4, 50, 50);
rect(5, 7, 45, 45);
rect(7, 9, 40, 40);
rect(10, 11, 35, 35);
rect(12, 12, 30, 30);
rect(14, 15, 25, 25);
rect(15, 17, 20, 20);
rect(18, 20, 15, 15);
rect(20, 22, 10, 10);
popMatrix();

}

//}```