//Fallon Creech
//Section B
//fcreech@andrew.cmu.edu
//Project-05
var x = 40;
function setup() {
createCanvas(560, 560);
}
function draw() {
background(220);
noStroke();
for (var i = 0; i < 15; i++) {
for (var j = 0; j < 15; j++) {
//fill every other column with all orange ellipses
if (j % 2 == 0) {
r = 245;
g = 125;
b = 0;
}
//fill every other column with orange circles in every other row
else if (i % 2 == 0) {
r = 255;
g = 165;
b = 0;
}
//fill every other column with purple circles in every other row
else if (j == j) {
r = 50;
g = 80;
b = 220;
fill(r, g, b);
rect(x * j, x * i, x, x);
}
fill(r, g, b);
ellipse(x * j, x * i, x, x);
}
}
}
I chose to approach this project as an extension of the assignments we worked on in lab, so I created a pattern of circles that used color to differentiate between row and column with one circle that adopted another quality.