xxxxxxxxxx
29
// CHANGE THIS
let radius = 15;
// CHANGE THIS
let w = 640, h = 360;
let size = 10;
let ci = w / (size * 2);
let cj = h / (size * 2);
function setup() {
createCanvas(w, h);
ci = int(ci);
cj = int(cj);
}
function draw() {
background(255);
strokeWeight(0.5);
for (let i = 0; i < width / size; i++) {
for (let j = 0; j < height / size; j++) {
noFill();
if ((i - ci) * (i - ci) + (j - cj) * (j - cj) <= (radius - 0.5) * (radius - 0.5)) fill(0);
square(i * size, j * size, size);
}
}
noLoop();
}