Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Adam Bloom
- //Sept. 2, 2011
- //Period 1 Comp Sci -- Nahm
- import edu.fcps.karel2.Display;
- import edu.fcps.karel2.Robot;
- public class Lab04
- {
- public static void takeTheField(Athlete arg)
- {
- arg.move();
- arg.move();
- arg.move();
- arg.move();
- arg.turnRight();
- arg.move();
- arg.move();
- }
- public static void main(String[] args)
- {
- Display.openWorld("maps/arena.map");
- Display.setSize(10, 10);
- Display.setSpeed(10);
- Athlete A = new Athlete();
- Athlete B = new Athlete();
- Athlete C = new Athlete();
- Athlete D = new Athlete();
- Athlete E = new Athlete();
- Athlete F = new Athlete();
- Robot Coach = new Robot(2, 7, Display.EAST, 0);
- takeTheField(A);
- takeTheField(B);
- takeTheField(C);
- takeTheField(D);
- takeTheField(E);
- takeTheField(F);
- A.move();
- A.move();
- A.move();
- A.move();
- A.turnRight();
- B.move();
- B.move();
- B.move();
- B.turnRight();
- C.move();
- C.move();
- C.turnRight();
- D.turnLeft();
- D.move();
- D.turnRight();
- D.move();
- D.turnRight();
- E.turnLeft();
- E.move();
- E.turnRight();
- E.move();
- E.move();
- E.move();
- E.move();
- E.move();
- E.turnRight();
- F.turnLeft();
- F.move();
- F.move();
- F.turnRight();
- F.move();
- F.move();
- F.move();
- F.turnRight();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement