Skip to content

Instantly share code, notes, and snippets.

@federico-pepe
Created September 30, 2015 14:44
Show Gist options
  • Select an option

  • Save federico-pepe/188192d7522b86bddcf5 to your computer and use it in GitHub Desktop.

Select an option

Save federico-pepe/188192d7522b86bddcf5 to your computer and use it in GitHub Desktop.
Controlli condizionali: esempio 2
/*
* 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