This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(condizione) { | |
| /* La porzione di codice qui inserita verrà eseguita | |
| * esclusivamente se la condizione sopra indicata | |
| * sarà true, quindi vera. | |
| */ | |
| } else { | |
| /* Nel caso in cui la condizione sopra inserita NON | |
| * sia vera, verrà eseguita questa porzione di codice | |
| */ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Controlli condizionali: if, else if, else | |
| * by Federico Pepe | |
| * http://blog.federicopepe.com | |
| */ | |
| void setup() { | |
| size(500, 500); | |
| stroke(255); | |
| } | |
| void draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Controlli condizionali: if, else if, else | |
| * by Federico Pepe | |
| * http://blog.federicopepe.com | |
| */ | |
| void setup() { | |
| size(500, 500); | |
| stroke(255); | |
| } | |
| void draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| } | |
| void draw() { | |
| if(mouseX < width/2) { | |
| if(mouseY < height/2 { | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| } | |
| void draw() { | |
| if((mouseX < width/2) && (mouseY < height/2)) { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| stroke(255); | |
| } | |
| void draw() { | |
| if((mouseX < width/2) && (mouseY < height/2)) { | |
| background(255, 0, 0); | |
| } else if((mouseX > width/2) && (mouseY < height/2)) { | |
| background(0, 255, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Esercizio 2: I quattro quadranti | |
| * by Federico Pepe | |
| * http://blog.federicopepe.com/processing | |
| */ | |
| void setup() { | |
| size(500, 500); | |
| stroke(255); | |
| fill(255); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| boolean var = true; | |
| int ellipseX = 0; | |
| void setup() { | |
| size(500, 500); | |
| } | |
| void draw() { | |
| background(0); | |
| ellipse(ellipseX, height/2, 50, 50); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int y = 10; | |
| void setup() { | |
| size(700, 500); | |
| background(255); | |
| while(y < height) { | |
| line(100, y, 600, y); | |
| y += 10; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(700, 500); | |
| background(255); | |
| for(int y = 10; y < height; y+=10) { | |
| line(100, y, 600, y); | |
| } | |
| } | |
| void draw() { | |
| } |