09. Funciones condicionales

El comando "if" pone en marcha una función condicional. La condición se establece entre paréntesis. Si la variable x es mayor que 3 escribe la palabra "Hola".

void setup()

{

size(650,200);

background(120, 120, 0);

}

void draw()

{

int x = 9;

textSize(100);

fill(0, 102, 153, 204);

text(x, 12, 80);


if(x>3){

fill(92, 175, 187, 50);

text("Hola", 40, 120);

}

}