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
| class Rotador{ | |
| float d; | |
| float r; | |
| float dr; | |
| Rotador(){ | |
| d = random(width/6,width/3); | |
| r = random(TWO_PI); | |
| dr = random(-0.05,0.05); | |
| } |
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
| interface Boton{ | |
| void display(); | |
| boolean over(); | |
| boolean pressed(); | |
| } |
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
| class Brillo { | |
| float x,y; | |
| float d; | |
| float t; | |
| float dt; | |
| float lt; | |
| boolean termina; | |
| Brillo(float x_,float y_){ | |
| x = x_; |
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
| size(400,400); | |
| background(255); | |
| ellipse(100,100,50,50); | |
| for (int i = 0; i<4; i++){ | |
| float x = 100 + sin(PI/2*i)*50; | |
| float y = 100 + cos(PI/2*i)*50; | |
| fill(255); | |
| ellipse(x,y,50,50); | |
| fill(0); | |
| ellipse(100 + sin(HALF_PI*i+PI/4)*30,100 + cos(HALF_PI*i+PI/4)*30,10,10); |
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
| size(400,400); | |
| background(255); | |
| noStroke(); | |
| for (int i = 0; i<100; i++){ | |
| color c = color(random(255),random(255),random(255)); | |
| float x = random(400); | |
| float y = random(400); | |
| float t = random(10,100); | |
| fill(c); | |
| ellipse(x,y,t,t); |
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
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int a = 5; | |
| int b = a++; | |
| cout<<a<<endl; | |
| cout<<b<<endl; |
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
| #include <iostream> | |
| using namespace std; | |
| int unaVariableGlobal = 1; //accesible en cualquier parte del programa | |
| int main(){ | |
| int unaVariableLocal = 2; //accesible dentro del bloque de la función main() | |
| //retira el comentario de abajo para producir un error | |
| //cout<<otraVariableLocal<<endl; | |
| cout<<unaVariableLocal<<endl; | |
| cout<<unaVariableGlobal<<endl; |
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
| #include <iostream> | |
| using namespace std; | |
| int unaVariableGlobal = 1; //accesible en cualquier parte del programa | |
| int main(){ | |
| int unaVariableLocal = 2; //accesible dentro del bloque de la función main() | |
| { | |
| int otraVariableLocal = 3; //accesible dentro de este sub-bloque | |
| } | |
| //retira el comentario de abajo para producir un error |
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
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| int unEntero = 50; | |
| float unNumeroFlotante = 1.2345; | |
| bool estadoDelFoco = true; | |
| bool otroFoco = 0; | |
| char unChar = 'c'; | |
| char otroChar = 67; |
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
| #include <iostream> | |
| using namespace std; | |
| int x,y,z; | |
| float unNumeroFlotante; | |
| bool estadoDelFoco; | |
| char unChar; | |
| int main(){ | |
| return 0; |
NewerOlder