xxxxxxxxxx
let virtualShape;
function setup() {
createCanvas(800, 800);
virtualShape = { x: 10, y: 10, width: 50, height: 50 };
noLoop();
}
function draw() {
strokeWeight(5);
stroke(0);
for (let i = 0; i < 8; i++) {
for (let j = 0; j < 8; j++) {
if (Math.random() < 0.05) {
ellipse(virtualShape.x + (virtualShape.height + 10) * i + 25, virtualShape.y + (virtualShape.width + 10) * j + 25, virtualShape.width, virtualShape.height);
} else {
rect(virtualShape.x + (virtualShape.height + 10) * i, virtualShape.y + (virtualShape.width + 10) * j, virtualShape.width, virtualShape.height);
}
}
}
}