import Robot.*;

public class locTest {    
    
    private Microbot    robot = new Microbot("COM1", Microbot.HOME);           

	//COMPILER GENERATED CODE; DO NOT MODIFY
	Location left = new Location(8.0,-3.0,0.5,-90.0,-20.0,"left");
	Location center = new Location(8.0,0.0,0.5,-90.0,0.0,"center");
	Location right = new Location(6.0,4.0,0.5,-90.0,20.0,"right");
	//COMPILER GENERATED CODE; DO NOT MODIFY

	public locTest() {       
        
        robot.speed(Microbot.FAST);
        
        stack();
        //robot.delay(5);
        unStack();
        robot.closePort();
    }
    
    private void stack() {
        robot.appro(left, 2);
        robot.movet(left,1.5);
        robot.close();
        robot.depart(2);
        robot.appro(center,3);
        robot.appro(center, 1.75);
        robot.open();
        robot.depart(2);        
        robot.appro(right, 2);
        robot.movet(right,1.5);
        robot.close();
        robot.depart(2);
        robot.appro(center,4);
        robot.appro(center, 2.75);
        robot.open();        
        robot.appro(Microbot.HOME,2);
        robot.ready();
    }
    
    private void unStack() {
        robot.depart(2);
        robot.appros(center,5.0);
        robot.openi(2);
        robot.appro(center,2.75);
        robot.close();
        robot.depart(1);
        robot.appro(right,2);
        robot.move(right);
        robot.open();
        robot.depart(3);
        robot.appros(center,4);
        robot.appros(center,1.75);
        robot.close();
        robot.depart(1);
        robot.appros(left,2);
        robot.move(left);
        robot.open();
        robot.depart(2);
        robot.ready();
    }
    
    public static void main(String args[]) {new locTest();};
}
