Square is not defined (?)

Hi everyone,

Sorry for this very basic question, but I’ve got the following error when using the square() function of p5.js, even if using the rect() function instead works very well :

Uncaught ReferenceError: square is not defined

See the code below. Any idea?

Thanks a lot :smile:

Laurent

var canvasWidth;
var canvasHeight;

function setup() {

  canvasWidth = 800;
  canvasHeight = 400;
  
  createCanvas(canvasWidth, canvasHeight);
  background(255);
  stroke(0);
  rect(30, 20, 55, 55);  
  square(30, 20, 55);
  
}

It runs if I paste your code in My Sketch - OpenProcessing and click the play :arrow_forward: icon. :running_man:

And I’ve got this sketch using square() too: :black_large_square:
GoSubRoutine.GitHub.io/Ball-in-the-Chamber/global/
https://github.com/GoSubRoutine/Ball-in-the-Chamber/blob/v2.0.3/global/sketch.js#L105-L108