Toggle navigation
Explora
(current)
Aprende
Crea
Retos
×
Aspectos básicos
void main() {...}
for ( int i = 0 ; i < N ; i++ ) {...}
while (condición) {...}
do {...} while (condición);
if (condición) {...}
if (condición) {...} else {...}
switch (valor) {...}
Mostrar y pedir datos
print()
println()
readInteger()
readDouble()
readChar()
readString()
Funciones matemáticas
abs(n)
log(n)
sqrt(n)
pow(b,e)
floor(n)
ceil(n)
round(n)
sin(n)
cos(n)
tan(n)
asin(n)
acos(n)
atan(n)
random(n)
Funciones gráficas
point(x,y)
line(x1,y1,x2,y2)
ellipse(x,y,w,h)
rect(x,y,w,h)
triangle(x1,y1,x2,y2,x3,y3)
text(msg,x,y)
textWidth(msg)
textSize(n)
background(r,g,b,a)
strokeWeight(n)
stroke(r,g,b,a)
noStroke()
fill(r,g,b,a)
noFill()
image(url, x,y,w,h)
Nuevo
Ayuda
Probar
...
/** * Ejemplo básico de uso de las funciones rect, line, triangle * y ellipse. **/ void main() { // Planta baja rect( 60,240, 100,80); rect( 80,270, 20,50); rect(120,270, 30,30); // Ventana line(135,270, 135,300); line(120,285, 150,285); // Tejado triangle(60,240, 110,200, 160,240); // Árbol rect(200,260, 10,60); ellipse(205,230,80,80); // Sol ellipse(320,0, 150,150); }
Canvas not supported.
Programado por
jlaguna
2 votos
502 descargas
99 usos