Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2011-01-10T19:19:07+00:00 → 2011-01-10T19:42:39+00:00
<language>Java</language> | |
| − | <eval id="4afd9e03e2f4c"> |
| + | <run id="4afd9e03e2f4c"> |
canvas.clear(); | |
java.util.Random random = new java.util.Random(); | |
Turtle John = new Turtle(1); | |
Turtle Junior = new Turtle(1); | |
int a = 0; | |
int c = 0; | |
int w = 1; | |
int x = 50; | |
int y = 90; | |
int z = 12; | |
John.home(); | |
John.move(359,160); | |
John.hide(); | |
Junior.home(); | |
Junior.move(239,160); | |
Junior.hide(); | |
void Ros(int d, int e){ | |
while (a < 20){ | |
Junior.left(w); | |
John.right(w); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
x--; | |
z--; | |
a++; } | |
a = 0; } | |
void Spirale(int b){ | |
while(c <= b){ | |
John.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Junior.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Ros(random.nextInt(500),random.nextInt(200)); | |
c++; } } Spirale(15); | |
</run> | |
<canvas></canvas> | |
| − | <eval id="4afd9e03e3a96"> |
| + | <run id="4afd9e03e3a96"> |
canvas2.clear(); | |
java.util.Random random = new java.util.Random(); | |
Turtle John = new Turtle(2); | |
Turtle Junior = new Turtle(2); | |
int a = 0; int c = 0; | |
int m = 0; int n = 0; int o = 0; | |
int t = 0; int u = 0; int v = 0; | |
int w = 1; | |
int x = 50; | |
int y = 90; | |
int z = 12; | |
John.home(); | |
John.move(359,160); | |
John.hide(); | |
Junior.home(); | |
Junior.move(239,160); | |
Junior.hide(); | |
void Ros(int x, int y){ | |
John.move(x,y); | |
while (a < 20){ | |
Junior.penColor(m,n,o); | |
John.penColor(t,u,v); | |
Junior.left(w); | |
John.right(w); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
m++; n--; o--; t--; u++; v++; x--; z--; | |
a++; } | |
a = 0; } | |
void Spirale(int b){ | |
while(c <= b){ | |
John.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Ros(random.nextInt(500),random.nextInt(200)); | |
c++; } } Spirale(5); | |
</run> | |
<canvas></canvas> | |
| − | <eval id="4afd9e03e4649"> |
| + | <run id="4afd9e03e4649"> |
canvas3.clear(); | |
java.util.Random random = new java.util.Random(); | |
Turtle John = new Turtle(3); | |
Turtle Junior = new Turtle(3); | |
int a = 0; | |
int c = 0; | |
int w = 1; | |
int x = 50; | |
int y = 90; | |
int z = 12; | |
John.home(); | |
John.move(359,160); | |
John.hide(); | |
Junior.home(); | |
Junior.move(239,160); | |
Junior.hide(); | |
void Ros(int x, int y){ | |
John.move(x,y); | |
while (a < 20){ | |
Junior.left(w); | |
John.right(w); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
x--; | |
z--; | |
a++; } | |
a = 0; } | |
void Spirale(int b){ | |
while(c <= b){ | |
John.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Junior.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Ros(random.nextInt(500),random.nextInt(200)); | |
c++; } } Spirale(5); | |
</run> | |
<canvas></canvas> | |
| − | <eval id="4afd9e03e5201"> |
| + | <run id="4afd9e03e5201"> |
canvas4.clear(); | |
java.util.Random random = new java.util.Random(); | |
Turtle John = new Turtle(4); | |
Turtle Junior = new Turtle(4); | |
int u = 0; | |
int v = 0; | |
int w = 1; | |
int x = 50; | |
int y = 300; | |
int z = 12; | |
John.home(); | |
John.move(359,160); | |
John.hide(); | |
Junior.home(); | |
Junior.move(239,160); | |
Junior.hide(); | |
void lol(int d, int e){ | |
while (u<=300){ | |
Junior.left(w); | |
John.right(w); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(x); | |
John.forward(x); | |
Junior.left(y); | |
John.right(y); | |
Junior.forward(z); | |
John.forward(z); | |
Junior.left(y); | |
John.right(y); | |
x--; | |
z--; | |
u++; } | |
u = 0; } | |
void Spirale(int b){ | |
while(v<=b){ | |
John.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
Junior.penColor(random.nextInt(255),random.nextInt(255),random.nextInt(255)); | |
lol(random.nextInt(500),random.nextInt(200)); | |
v++; } } Spirale(0); | |
</run> | |
<canvas></canvas> | |
| − | <eval id="4afd9e03e5dba"> |
| + | <run id="4afd9e03e5dba"> |
canvas5.clear(); | |
Turtle John = new Turtle(5); | |
int s = 40; | |
int t = 30; | |
int u = 30; | |
int v = 400; | |
int w = 1; | |
int x = 10; | |
int y = 300; | |
int z = 12; | |
John.home(); | |
John.hide(); | |
John.penErase(); | |
do { | |
John.penColor(t,u,v); | |
John.right(w); | |
John.penErase(); | |
John.forward(s); | |
John.penColor(t,u,v); | |
John.forward(x); | |
John.right(y); | |
John.forward(z); | |
John.right(y); | |
John.forward(x); | |
John.penErase(); | |
John.forward(s); | |
John.right(y); | |
John.penErase(); | |
John.forward(z); | |
John.right(y); | |
s++; | |
t--; | |
u--; | |
v++; | |
x--; | |
z--; | |
} while (v<=1700); | |
</run> | |
<canvas></canvas> |