xxxxxxxxxx
67
let angles = [0,90,180,270];
//var factor = [1,0.5,0,1.5];
//let start = 0;
//let rot = 180;
//let i = [0,1,2,3];
let col = [0,100,200,150,70];
let shape = 0;
function setup() {
createCanvas(600, 600);
background(255);
//fill(0);
//angleMode(DEGREES);
noStroke();
}
function draw() {
/*for(let y = 0; y<12; y++){
for(let x = 0; x<12; x++){
push();
translate(x*50+25,y*50+25);
rotate(int(random(4))*HALF_PI);
arc(-25,-25,100,100,0,PI/2,PIE);
pop();
}
} */
/*var rad = 600/12;
for(let i = 0; i<=600; i+=rad){
for(let j = 0; j<=600; j+=rad){
start = angles[int(random(3))];
arc(i,j,rad*2,rad*2,start,start+90,PIE);
}
}*/ //finish this part
///////////////////////////////////////////
for(let y = 0; y<12; y++){
for(let x = 0; x<12; x++){
shape = int(random(3));//random returns float, (0,1,2)
fill(int(random(col)));
push();
translate(x*50+25,y*50+25);
rotate(int(random(4))*HALF_PI);
if(shape == 1){
arc(-25,-25,100,100,0,PI/2,PIE);
}else if(shape == 2){
rect(-25,-25,50,10);
rect(-25,-10,50,10);
rect(-25,5,50,10);
}else{
ellipse(0,0,40,20);
}
pop();
}
}
noLoop();
}