You are on page 1of 3

//Name David Willmore import edu.pace.Robot; import edu.pace.

World;

Date 30 Nov. 2011

public class Climber extends Athlete { public Climber(int x) { super(x, 1, World.NORTH, 1); } // Climber public void climbUpRight() { move(); move(); turnRight(); move(); } // climbUpRight public void climbUpLeft() { turnRight(); move(); move(); turnLeft(); move(); } // climbUpLeft public void travelLeft() { turnLeft(); move(); turnRight(); } // travelLeft public void travelRight() { turnRight(); move(); turnLeft(); } // travelRight public void climbDownRight() { move(); turnRight(); move(); move(); turnLeft(); } // climbDownRight public void climbDownLeft() { move(); turnLeft(); move(); move(); turnRight(); } // climbDownLeft } //class

//Name David Willmore import edu.pace.World; import edu.pace.Robot;

Date 28 Nov. 2011

public class Lab03 { public static void main(String[] args) { World.readWorld("mountain"); World.setSize(16, 16); World.setSpeed(10); Climber bob = new Climber(8); Climber sue = new Climber(8); bob.putBeeper(); bob.travelRight(); sue.travelRight(); bob.climbUpRight(); sue.climbUpRight(); bob.turnLeft(); sue.turnLeft(); bob.climbUpRight(); sue.climbUpRight(); bob.turnLeft(); sue.turnLeft(); bob.climbUpRight(); sue.climbUpRight(); bob.climbDownRight(); sue.climbDownRight(); bob.climbDownRight(); sue.climbDownRight(); bob.pickBeeper(); bob.turnAround(); sue.turnAround(); bob.climbUpLeft(); sue.climbUpLeft(); bob.climbUpLeft(); sue.climbUpLeft(); bob.climbDownLeft(); sue.climbDownLeft(); bob.climbDownLeft(); sue.climbDownLeft(); bob.climbDownLeft(); sue.climbDownLeft(); bob.turnRight(); sue.turnRight(); bob.travelLeft(); sue.travelLeft(); bob.putBeeper(); bob.travelRight(); sue.travelRight(); } }

You might also like