Project 5 – Wallpaper

I had a really hard time doing this one, the array functions were giving me difficulty and at one point I created a file that just crashed the html file permanantly so I kept having to make more files but I figured them out in the end and ended there.

sketchDownload
var s = [10,15,20,25,20,15];
var x=20;
var y=20;
var c=0;
function setup(){
    createCanvas(600, 600);
    background(255);
}

function draw() {
fill(0); 
for(var l = 0;l <= 5;l += 1){
    y = 20
    for(var h = 0; h <= 5;h += 1){
    x = 20+c;
     for(var i = 0;i < 6;i ++){

        circle(x,y,s[i]);
        x += 15;
        y += 15;
     }
     y += 5;
    }
    c += 90;
}
noLoop();
}

Leave a Reply