Basic set-up:

setup() vs. draw()

variables & frameRate()

let x = 0
function setup() {
  createCanvas(400, 400);
  background(100);
}

function draw() {
	ellipse(x, height/2, 20, 20);
    x = x + 40;
    frameRate(2);
    console.log(x)  
}

Gaps in a row

function setup() {
  createCanvas(400, 400);
  background(240)
}

function draw() {

  noLoop();
  noStroke();
  fill('purple');
  let numCircles = 10;
  let r = (width)/numCircles;
  let gap = 5;
    
  for (x = 0; x < numCircles; x++){
    let xCoor = x * r + x * gap;
    ellipse(xCoor, height/2, r);
    console.log(x*r)
  }
}
//...sames as above plus

for (y = 0; y < numCircles; y++){
    let yCoor = y * r + y * gap;
    ellipse (width/2, yCoor, r)
    console.log(yCoor)
  }

Skyline

https://editor.p5js.org/mariatragonas/full/KJrvE68Rz