We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I've run into an issue of infinite loops and I am baffled at why. It's a very simple loop. This is the entire length of code here.
function setup() {
createCanvas(800, 600);
}
function draw() {
for(var i = 0; i < 5; i++) {
ellipse(random(800), random(600), 25, 25);
}
}
As far as I can tell from other peoples code and references to the for loop syntax, this should only run 5 times, yet it is infinite. Changing the second argument in the for loop only seems to either speed up or slow down the amount of ellipses drawn per frame, which also confuses me.
Any help is appreciated, thanks.
Answers
https://forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
http://p5js.org/reference/#/p5/draw
http://p5js.org/reference/#/p5/noLoop
Draw gets called 60 times a second, by default. Use noLoop to stop this. See reference links above.