```let refresh = true, num_lines = 12, lines = [], line_length = 300;   function setup() { createCanvas(720, 480) }   function draw() {   if (refresh) { refresh = false; lines = [], clear(); background(237, 243, 255);   // generate lines for (let x = 0; x &lt;= num_lines; x++) {   let l = {}; l.x1 = random(width); l.y1 = random(height); // create random second point on a circle let angle = random() * Math.PI * 2; l.x2 = (Math.cos(angle) * line_length) + l.x1 l.y2 = (Math.sin(angle) * line_length) + l.y1; lines.push(l); }   fill(140, 184, 255); noStroke();   // check lines for intersection for (let x = 0; x &lt;= num_lines; x++) { for (let y = 0; y &lt; num_lines; y++) {   if (y != x){ let res = intersects(lines[x], lines[y]); if (res != false) ellipse(res.x, res.y, 20, 20); } } }   stroke(0); strokeWeight(2);   // draw lines for (let x = 0; x &lt;= num_lines; x++) { line(lines[x].x1, lines[x].y1, lines[x].x2, lines[x].y2); }   } }   function mousePressed() { refresh = true }   // algorithm from Paul Bourke http://paulbourke.net/geometry/pointlineplane/ // adapted from Leo Bottaro's implementation // calculate intersection point of two lines function intersects(l1, l2) {   let denom = ((l2.y2 - l2.y1) * (l1.x2 - l1.x1) - (l2.x2 - l2.x1) * (l1.y2 - l1.y1));   let ua = ((l2.x2 - l2.x1) * (l1.y1 - l2.y1) - (l2.y2 - l2.y1) * (l1.x1 - l2.x1)) / denom; let ub = ((l1.x2 - l1.x1) * (l1.y1 - l2.y1) - (l1.y2 - l1.y1) * (l1.x1 - l2.x1)) / denom;   if (ua &lt; 0 || ua &gt; 1 || ub &lt; 0 || ub &gt; 1) return false;   let x = l1.x1 + ua * (l1.x2 - l1.x1); let y = l1.y1 + ua * (l1.y2 - l1.y1);   return {x, y}; }```
```  let refresh = true, box_width = 40, box_padding = 10;   function setup() { createCanvas(400, 400); background(255); noStroke(); }   function draw() {   if (refresh) { refresh = false; clear(); background(255);   for (let x = 5; x &lt;= width - box_width; x += (box_width + box_padding)) {   for (let y = 5; y &lt;= height - box_width; y += (box_width + box_padding)) {   let rand = Math.ceil(random(15)); // 1 in 15 chance there is a circle if (rand == 1) { fill(66, 134, 244); ellipse((x + box_width/2), (y + box_width/2), box_width, box_width); } else { fill(195, 198, 204); rect(x, y, box_width, box_width); } } } } }   function mousePressed() { refresh = true; }```