Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import unit4.turtleLib.Turtle;
- public class RunTurtle {
- public static void main(String[] args) {
- Turtle t = new Turtle();
- t.tailDown();
- t.setTailColor(Color.BLUE);
- t.moveForward(100);
- t.turnRight(90);
- t.moveForward(100);
- t.turnRight(90);
- t.moveForward(100);
- t.turnRight(90);
- t.setTailColor(Color.RED);
- t.moveForward(200);
- t.setTailColor(Color.BLUE);
- t.turnLeft(90);
- t.moveForward(100);
- t.turnLeft(90);
- t.moveForward(100);
- t.turnLeft(90);
- t.moveForward(100);
- t.tailUp();
- t.turnLeft(90);
- t.moveBackward(200);
- t.tailDown();
- t.setTailColor(Color.GREEN);
- for (int i = 0; i < 20; i++) {
- t.moveForward(20);
- t.turnLeft(18);
- }
- for (int i = 0; i < 20; i++) {
- t.moveForward(20);
- t.turnRight(18);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement