Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2009-11-13T17:50:43+00:00 → 2011-01-10T19:42:38+00:00
<language>Java</language> | |
| − | <eval id="4afd9c7381919"> |
| + | <run id="4afd9c7381919"> |
canvas.clear(); | |
Turtle John = new Turtle(1); | |
int t = 0; | |
int u = 0; | |
int v = 0; | |
int w = 1; | |
int x = 200; | |
int y = 90; | |
int z = 50; | |
John.home(); | |
John.hide(); | |
John.penErase(); | |
do { | |
John.penColor(t,u,v); | |
John.right(w); | |
John.forward(x); | |
John.right(y); | |
John.forward(z); | |
John.right(y); | |
John.forward(x); | |
John.right(y); | |
John.forward(z); | |
John.right(y); | |
x--; | |
z--; | |
} while (x>=-380); | |
| − | </eval> |
| + | </run> |
<canvas></canvas> | |
| + | |
| + | <run id="4afd9d6070e35"> |
| + | canvas2.clear(); |
| + | Turtle John = new Turtle(2); |
| + | |
| + | int w = 1; |
| + | int x = 50; |
| + | int y = 90; |
| + | int z = 12; |
| + | |
| + | John.home(); |
| + | John.hide(); |
| + | |
| + | do { |
| + | John.right(w); |
| + | John.forward(x); |
| + | John.right(y); |
| + | John.forward(z); |
| + | John.right(y); |
| + | John.forward(x); |
| + | John.right(y); |
| + | John.forward(z); |
| + | John.right(y); |
| + | x--; |
| + | z--; |
| + | } while (x>=-1000); |
| + | </run> |
| + | <canvas></canvas> |
| + | |
| + | <run id="4afd9d60719de"> |
| + | canvas3.clear(); |
| + | Turtle John = new Turtle(3); |
| + | Turtle Junior = new Turtle(3); |
| + | int m = 50; |
| + | int n = 50; |
| + | int o = 50; |
| + | int t = 50; |
| + | int u = 50; |
| + | int v = 50; |
| + | 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(); |
| + | do { |
| + | 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--; |
| + | } while(m!=360); |
| + | </run> |
| + | <canvas></canvas> |
| + | |
| + | <run id="4afd9d6072598"> |
| + | canvas4.clear(); |
| + | Turtle John = new Turtle(4); |
| + | Turtle Junior = new Turtle(4); |
| + | 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(); |
| + | do { |
| + | 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--; |
| + | } while (m!=320); |
| + | </run> |
| + | <canvas></canvas> |
| + | |
| + | <run id="4afd9d6073156"> |
| + | canvas5.clear(); |
| + | java.util.Random random = new java.util.Random(); |
| + | Turtle John = new Turtle(5); |
| + | Turtle Junior = new Turtle(5); |
| + | 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 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> |