Created
September 30, 2015 14:44
-
-
Save federico-pepe/188192d7522b86bddcf5 to your computer and use it in GitHub Desktop.
Controlli condizionali: esempio 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
| /* | |
| * Controlli condizionali: if, else if, else | |
| * by Federico Pepe | |
| * http://blog.federicopepe.com | |
| */ | |
| void setup() { | |
| size(500, 500); | |
| stroke(255); | |
| } | |
| void draw() { | |
| if (mouseX > 200) { | |
| background(200); | |
| } else if (mouseX > 100) { | |
| background(127); | |
| } else { | |
| background(0); | |
| } | |
| line(100, 0, 100, height); | |
| line(200, 0, 200, height); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment