xxxxxxxxxx
var posX = 0;
var posY = 0;
function setup() {
createCanvas(500, 500);
background(250, 105, 0);
}
function draw() {
var r = random(1);
noFill();
stroke(243, 234, 48);
if (r < .25) {
//triangle(posX, posY, posX + 10, posY + 10, posX+ 10, posY);
arc(posX, posY, 40, 40, 0, HALF_PI);
} else if(r >= 1/6 && r < 2/6) {
arc(posX, posY+20, 40, 40, PI+HALF_PI, 0);
//triangle(posX, posY + 10, posX + 10, posY, posX + 10, posY + 10);
} else if (r >= 2/6 && r < 3/6) {
arc(posX + 20, posY, 40, 40, HALF_PI, PI);
//triangle(posX, posY+10, posX+10, posY, posX, posY);
} else if (r >= 3/6 && r < 4/6) {
arc(posX + 20, posY + 20, 40, 40, PI, PI + HALF_PI);
//triangle(posX, posY, posX+10, posY+10, posX, posY+10);
} else if (r >= 4/6 && r < 5/6) {
line(posX, posY, posX + 20, posY + 20);
} else {
line(posX, posY + 20, posX + 20, posY);
}
posX += 20
if (posX >= width) {
posY = posY + 20;
posX =0;
}
if (posY >= height) {
noLoop;
}
}