Skip to content

Instantly share code, notes, and snippets.

@federico-pepe
Created October 7, 2015 17:22
Show Gist options
  • Select an option

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

Select an option

Save federico-pepe/51fec73588ef752d5ef1 to your computer and use it in GitHub Desktop.
Operatori Logici 3
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);
} else {
background(0);
}
line(width/2, 0, width/2, height);
line(0, height/2, width, height/2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment