We are about to switch to a new forum software. Until then we have removed the registration on this forum.
code by "while" void draw() { x=0; y=0; while(x<width){ x=x+20;
while(y<height){ y=y+20; star(x,y); }
}
code by "for"
void draw() { for (x=0; x<width;x= x+20) { for (y=0; y<height;y= y+20) { star(x, y); } } }
variables, x&y were defined already, and star() also was defined based off of variables x and y.
why only the "for" function works here? and what should I do to make the "while" function work as well?
Always thank you for everyone helping me.
Answers
https://Forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
You've gotta reset y iterator variable back to its initial value for the inner
while () {}
loop before it starts every time! L-)for () {}
loops automatically reset their iterator back to its initial value before they start. \m/