karinac-Project-05

karinac-Project-05

//Karina Chiu
//Section C
//karinac@andrew.cmu.edu
//Project-05

function setup() {
    createCanvas(500,500);
}
 
function draw() {
    background(138,0,45);

    //first set of boxes
    for (var y = 30; y < height-30; y += 90) {
        for (var x = 30; x < width-30; x += 90) {
            stroke(250);
            strokeWeight(10);
        	noFill();
            rect(x, y, 70, 70);
        }
    }

    //underneath layer of boxes
    for (var a = 50; a < height-80; a += 90) {
        for (var b = 50; b < width-80; b += 90) {
            stroke(250);
            strokeWeight(6);
            noFill();
            rect(a, b, 70, 70);
        }
    }
}

I wanted to create a wallpaper with simple geometric designs that are not too distracting. The hardest part I faced was trying to find the parameters for the loop.

Leave a Reply