We are about to switch to a new forum software. Until then we have removed the registration on this forum.
function setup() { createCanvas(800,800) background(0) noFill() function draw() { for (var n = 0; n <= 300; n = n + 1) { var linep = { x: random(0, width), y: random(0, height) } stroke(255, 255, 255) line(linep.x, linep.y, width / 2, height / 2) } }
this is the code and you can see in the code that the number of lines drawn should be 300 but it draws endlessly. Can someone explain why? Thanks
Answers
I easily solved it with a while function but I want to know why does it loop endlesly
draw is a loop...
https://forum.processing.org/two/discussion/8087/what-are-setup-and-draw
thanks