Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2009-11-08T11:12:28+00:00 → 2011-01-10T19:42:36+00:00
<language>Java</language> | |
| − | <eval id="4af6a79cafd89"> |
| + | <run id="4af6a79cafd89"> |
canvas1.clear(); | |
Turtle turtlea = new Turtle(1); | |
Turtle turtleb = new Turtle(1); | |
turtlea.home(); | |
turtleb.home(); | |
turtlea.hide(); | |
turtleb.hide(); | |
int a=25; | |
int w=5; | |
int c=0; | |
int d=0; | |
int zufallszahl1=0; | |
int zufallszahl2=0; | |
int r=0; | |
int g=0; | |
int b=0; | |
int z=3; | |
turtlea.penWidth(z); | |
turtleb.penWidth(z); | |
java.util.Random random = new java.util.Random(); | |
while(d<100){ | |
c=0; | |
w=90; | |
z=0; | |
zufallszahl1 = random.nextInt(600); | |
zufallszahl2 = random.nextInt(150); | |
r = random.nextInt(255); | |
g = random.nextInt(255); | |
b = random.nextInt(255); | |
turtlea.move(zufallszahl1,zufallszahl2); | |
turtleb.move(zufallszahl1,zufallszahl2); | |
turtlea.penColor(r,g,b); | |
turtleb.penColor(b,r,g); | |
while(c<=10){ | |
turtlea.right(z); | |
turtleb.left(z); | |
turtlea.forward(a); | |
turtleb.forward(a*2); | |
turtlea.right(w); | |
turtleb.left(w); | |
turtlea.forward(a); | |
turtleb.forward(a*2); | |
turtlea.right(w); | |
turtleb.left(w); | |
turtlea.forward(a); | |
turtleb.forward(a*2); | |
turtlea.right(w); | |
turtleb.left(w); | |
turtlea.forward(a); | |
turtleb.forward(a*2); | |
c++; | |
z+=5; | |
} | |
d++; | |
} | |
| − | </eval> |
| + | </run> |
<canvas w=800 h=350></canvas> |