xxxxxxxxxx
32
// Gpt-4
const numPoints = 50;
let points = [];
function setup() {
createCanvas(800, 800);
for (let i = 0; i < numPoints; i++) {
points.push(createVector(random(width), random(height)));
}
}
function draw() {
background(240);
stroke(0);
strokeWeight(1);
// Draw the points
for (let i = 0; i < points.length; i++) {
ellipse(points[i].x, points[i].y, 4);
}
// Connect all points with lines
for (let i = 0; i < points.length; i++) {
for (let j = i + 1; j < points.length; j++) {
line(points[i].x, points[i].y, points[j].x, points[j].y);
}
}
noLoop(); // Stop the draw loop, as the image is static
}