//Symmetrical Loop-Based Composition //PS1 #7 //Konstantino Kapetaneas - 500324892 //If you look at the top row and then the bottom row //back and forth, it gets a little funky size(400, 400); background(#e9f9aa); smooth(); noFill(); stroke(#e9f9aa); strokeWeight(3); //Original idea: //rect(0, 100, 50, 50); //rect(50, 150, 50, 50); //rect(100, 100, 50, 50); //rect(150, 150, 50, 50); //rect(200, 100, 50, 50); //rect(250, 150, 50, 50); //Using "k" as a variable because I like it pushMatrix(); translate(0, -100); int p = 0; for (int k = 0; k < width; k = k + 50) { if (p==0) { p = p + 50; } else { p = 0; } fill(#c2d868); rect(k, 150+p, 50, 50); } for (int k = 0; k < width; k = k + 50) { if (p==0) { p = p + 50; } else { p = 0; } fill(#7eef19); ellipse(k, 150+p, 50, 50); } popMatrix(); pushMatrix(); translate(0, 100); int c = 0; for (int k = 0; k < width; k = k + 50) { if (c==0) { c = c + 50; } else { c = 0; } fill(#c2d868); rect(k, 150+c, 50, 50); } for (int k = 0; k < width; k = k + 50) { if (c==0) { c = c + 50; } else { c = 0; } fill(#7eef19); ellipse(k, 150+c, 50, 50); } popMatrix();