why won't my simple loop work?????
in
Programming Questions
•
3 years ago
i'm trying to run a simple loop in the setup, however it seems processing is simply skipping over it. you'll see i've put in four different println commands in the script: one before the loop, one after the loop, and two within the loop itself. when i run this code, the first and last println commands appear (the ones outside of the loop), however the ones inside the loop are not shown. there are no error messages reported. what the hell is going wrong? code:
circle[] CIRCLES;
void setup(){
size(500,500);
background(255);
smooth();
CIRCLES = new circle[30];
println("line before loop");
for(int i=0; i>30; i++){
println("the initiating loop has run");
CIRCLES[i] = new circle(random(0,width),random(0,height));
CIRCLES[i].display();
println("and this line is proof");
}
println("line after loop");
}
circle[] CIRCLES;
void setup(){
size(500,500);
background(255);
smooth();
CIRCLES = new circle[30];
println("line before loop");
for(int i=0; i>30; i++){
println("the initiating loop has run");
CIRCLES[i] = new circle(random(0,width),random(0,height));
CIRCLES[i].display();
println("and this line is proof");
}
println("line after loop");
}
1