canvas.clear(); Turtle turtlea = new Turtle(1); Turtle turtleb = new Turtle(1); turtlea.home(); turtleb.home(); turtlea.hide(); turtleb.hide(); int anzahl = 0; int w = 100; int winkel = 0; int a = 255; int b = 0; int c = 0; while (anzahl<=250){ turtlea.move(150,100); turtleb.move(450,100); turtlea.right(winkel); turtleb.right(winkel); turtlea.penColor(a,b,c); turtleb.penColor(a,b,c); turtlea.forward(w); turtleb.forward(w); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(225); turtleb.right(225); turtlea.forward(30); turtleb.forward(30); anzahl++; winkel++; a--; b++; }while(anzahl<=500){ turtlea.move(150,100); turtleb.move(450,100); turtlea.penColor(a,b,c); turtleb.penColor(a,b,c); turtlea.right(winkel); turtleb.right(winkel); turtlea.forward(w); turtleb.forward(w); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(90); turtleb.right(90); turtlea.forward(w/2); turtleb.forward(w/2); turtlea.right(225); turtleb.right(225); turtlea.forward(w); turtleb.forward(w); anzahl++; winkel--; c++; b--; }
ausführen