Created
August 19, 2015 10:45
-
-
Save federico-pepe/bf371713e52608aaeeac to your computer and use it in GitHub Desktop.
Hard coding vs built-in variables
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
| /* | |
| * Hard coding vs built-in variables | |
| * by Federico Pepe | |
| * http://blog.federicopepe.com | |
| */ | |
| void setup() { | |
| // Imposto la grandezza della finestra a 500x500px | |
| size(500, 500); | |
| // 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