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);
ausführen
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);
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);
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);
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);