canvas1.clear(); java.util.Random random = new java.util.Random(); Turtle Sam = new Turtle(1); int a = 0; int c = 0; void Ros(int x, int y){ Sam.move(x,y); while (a < 20){ if (a%2 == 0) Sam.penColor(150, 0, 0); else Sam.penColor(0, 0, 0); Sam.forward(50); Sam.right(90); Sam.right(50); a++; } a = 0; } void Rosette(int b){ while(c < b){ Ros(random.nextInt(500),random.nextInt(200)); c++; } } Rosette(10);
ausführen