Skip to content

Instantly share code, notes, and snippets.

@federico-pepe
Created August 19, 2015 10:51
Show Gist options
  • Select an option

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

Select an option

Save federico-pepe/210b1c871b309ac2b90f to your computer and use it in GitHub Desktop.
Hard coding vs built-in variables
/*
* Hard coding vs built-in variables
* by Federico Pepe
* http://blog.federicopepe.com
*/
void setup() {
// Imposto la grandezza della finestra a 700x700px
size(700, 700);
// Imposto colore di riempimento ed elimino il bordo
noStroke();
fill(255, 0, 0, 100);
// Disegno un cerchio di diametro 100px al centro
// della finestra utilizzando l'hard-coding
ellipse(250, 250, 100, 100);
// Disegno un cerchio di diametro 150px al centro
// della finestra utilizzando due variabili built-in
ellipse(width/2, height/2, 150, 150);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment