/**
 * <code>Main2</code> contains the main method for exercise 2.2.  The
 * main method is fully implemented; thus, do not make any changes to
 * this code.
 */

public class Main2 {
    /**
     * Creates a maze of 7*2 rooms and moves a
     * <code>MarchingRobot</code> in the maze.
     * @param args is ignored.
     */
    public static void main(String[] args) {
	Maze m = new Maze(7, 2);
	m.connectRooms(0, 0, 6, 0);
	m.connectRooms(0, 1, 6, 1);
	m.connectRooms(6, 0, 6, 1);

	MarchingRobot robot = new MarchingRobot(0);
	robot.setRoom(m.getRoom(0, 0));
	System.out.println(robot);
	m.print();

	Room room = robot.marchForward(1);
	m.print();
	System.out.println("Robot " + robot + " is in room " + room);

	room = robot.marchForward(2);
	m.print();
	System.out.println("Robot " + robot + " is in room " + room);

	room = robot.marchForward(0);
	m.print();
	System.out.println("Robot " + robot + " is in room " + room);

	room = robot.marchForward(3);
	m.print();
	System.out.println("Robot " + robot + " is in room " + room);
    }
}
