question about the 'width' variable
in
Programming Questions
•
6 months ago
void setup() {
size(200,200);
frameRate(5);
}
int r = 200;
int m = width - 20;
void draw() {
background(255);
while(r > m) {
ellipse(100,100,r,r);
r-=20;
}
I supposed that the while() function only execute on time that only draw the circle with r=200 then exit, but the result shows 10 circles, seeming to run 10 times until r = 0 then exit. So I think there must be something wrong with the 'm' variable. If I directly set the m equals 180, there is no problem at all, but what's wrong with the width's value, shouldn't it be equal to 200?
1