xxxxxxxxxx
34
let x = 0;
let y = 0;
let sp = 40;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
background(50, 100, 75);
}
function draw() {
stroke(255);
let r = random(1);
//rect(x, y, sp, sp);
if (r < 0.33) {
fill(255, 0, 255, 100);
arc(x + sp, y + sp, sp * 2, sp * 2, 90, 180);
// line(x, y, x + spacing, y + spacing);
} else if (r < 0.67) {
fill(0, 255, 255, 100);
arc(x, y, sp * 2, sp * 2, 0, 90);
// line(x, y + sp, x + sp, y);
} else {
fill(255, 255, 0, 100);
arc(x, y, sp * 2, sp * 2, 180, 270);
// line(x, y + sp, x + sp, y);
}
x = x + sp;
if (x > width) {
x = 0;
y = y + sp;
}
}