Clear the Rooms preparation

To get ready: solve each of these 3 problems separately:

  1. A Jeroo is in a room with no nets (remove the nets for this exercise) Each room has an exit that is to the east or west. Find the exit. Place a jeroo in each room of a Rooms island and prove it works. It should work no matter where the Jeroo is inside each room or which way it starts out facing.
  2. Find a net in a room that is guaranteed to be rectangular with water completely covering the north and south sides and a single exit, one block wide, on either the east or west side. Stop when the net has been disabled. Prove it works with 4 Jeroos on a single Rooms island
  3. Have a Jeroo traverse the hallway of flowers, starting at the north end of the hall facing south l with 4 flowers in its pouch. Have it deposit 1 flower inside of the opening of each room and stop when it reaches the south end of the hall.

rooms Here is some code that should work to place the Jeroos in any of the Rooms islands. Change the directions they are facing and also try starting them in a corner or on a wall to fully test your program.

	method main(){
		Jeroo a = new Jeroo(8,5,SOUTH,1);
		Jeroo b = new Jeroo(14,9,EAST,1);
		Jeroo c = new Jeroo(6,18,NORTH,1);
		Jeroo d = new Jeroo(22,15,WEST,1); // won't work in Rooms 4 move to (1,9)
	}	

Then, try the full Clear the Rooms program