Very interesting. So an a global mode design, rather than having different setup/draw, a single sketch can re-invoke its own … what, its own setup / createCanvas, or its own custom reset() ? – creating a new canvas, or new canvas contents with different parameters?
Regarding this:
function setup() {
createCanvas(600, 600).mousePressed(reset);
Coming from primarily Java / Python etc, I would expect clicking the mouse during draw() to do nothing, yet it does – so the method chaining in setup() must be configuring something that I don’t quite understand. I’m assuming the mouse calls reset() rather than calling setup()…