Lab05

Discussion in 'Bing' started by jimy, Oct 6, 2006.

  1. #1
    ie maelaf, 9/22
    import edu.pace.World;
    import edu.pace.Robot;

    public class Lab05
    {
    public static void runTheRace(Racer arg)
    {
    //First Run
    arg.move();
    arg.jumpRight();
    arg.sprint(2);
    arg.pick(7);
    arg.turnAround();
    arg.sprint(2);
    arg.jumpLeft();
    arg.move();
    arg.put(7);
    arg.turnAround();

    //Second Run
    arg.move();
    arg.jumpRight();
    arg.sprint(4);
    arg.pick(5);
    arg.turnAround();
    arg.sprint(4);
    arg.jumpLeft();
    arg.move();
    arg.put(5);
    arg.turnAround();

    //Third Run
    arg.move();
    arg.jumpRight();
    arg.sprint(6);
    arg.pick(3);
    arg.turnAround();
    arg.sprint(6);
    arg.jumpLeft();
    arg.move();
    arg.put(3);
    arg.turnAround();

    //Finish The Race
    arg.move();
    }
    public static void main (String[] args)
    {
    //set-up world
    World.readWorld("shuttle");
    World.setSize (10,10);
    World.setSpeed (10);

    //create three objects
    Racer jo = new Racer(1);
    Racer ho = new Racer(4);
    Racer kl = new Racer(7);

    //Perform Task
    runTheRace(jo);
    runTheRace(ho);
    runTheRace(kl);

    }
    }
     
    jimy, Oct 6, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You forgot a comma on line 248.
     
    T0PS3O, Oct 6, 2006 IP