
/**
 * Initial demo of Karel - move a beeper from one corner
 * to another, then go to the origin and turn off
 * 
 * @author Russell C. Bjork
 * @version January 6, 2006
 */
import kareltherobot.*;

public class InitialDemo implements Runnable
{
	/** Main method - set up the world and start the program
	 */
    public static void main(String [] args)
    { 
      	World.readWorld("InitialDemo.world");
      	World.setVisible(true);
      	World.setupThread(new InitialDemo());
      	World.setTrace(false);
      	World.showSpeedControl(true);
    }
    
    /** Method that describes the task to be performed.
     */  
    public void run()
    {
       // Create a new robot at 1st and 1st, facing East, with no beepers
 		
        Robot karel = new Robot(1, 1, Directions.East, 0);        

		// Go to beeper at corner of 2nd and 2nd and pick it up
		
		karel.move();
 		karel.turnLeft();
		karel.move();
 		karel.pickBeeper();
 		
 		// Take it to 3rd and 3rd and drop it off
 		
 		karel.move();
 		karel.turnLeft();
 		karel.turnLeft();
 		karel.turnLeft();
 		karel.move();
 		karel.putBeeper();
 		
 		// Go back to 1st and 1st, face East, and turn off
 		
 		karel.turnLeft();
 		karel.turnLeft();
 		karel.move();
 		karel.move();
 		karel.turnLeft();
 		karel.move();
 		karel.move();
 		karel.turnLeft();
		karel.turnOff();
    }
}