Noob question about switches/rendering
in
Programming Questions
•
1 years ago
i have a quick question about the way processing works. how come this doesnt work:
- size(500, 500);
- background(255);
- strokeWeight(5);
- smooth();
- noFill();
- for(int i = 1; i <= 3; i++){
- int colorSelect = i;
- switch(colorSelect){
- case 1:
- stroke(#FF0000);
- case 2:
- stroke(#00FF00);
- case 3:
- stroke(#0000FF);
- }
- ellipse(height / 2, width / 2, i * 50, i * 50);
- }
- size(500, 500);
- background(255);
- strokeWeight(5);
- smooth();
- noFill();
- for(int i = 1; i <= 3; i++){
- int colorSelect = i;
- if(i == 1){
- stroke(#FF0000);
- }
- else if(i == 2){
- stroke(#00FF00);
- }
- else{
- stroke(#0000FF);
- }
- ellipse(height / 2, width / 2, i * 50, i * 50);
- }
1