import java.util.Vector;

public class Verifier
{
    private static final String EXAMPLE1_FILE = "example1.txt";
    private static final int EXAMPLE1_STEPS = 8;
    private static final String EXAMPLE2_FILE = "example2.txt";
    private static final int EXAMPLE2_STEPS = 86;
    private static final String EXAMPLE3_FILE = "example3.txt";
    private static final int EXAMPLE3_STEPS = 132;
    private static final String EXAMPLE4_FILE = "example4.txt";
    private static final int EXAMPLE4_STEPS = 136;
    private static final String EXAMPLE5_FILE = "example5.txt";
    private static final int EXAMPLE5_STEPS = 81;

    public Verifier (boolean debug)
    {
        _debug = debug;
    }

    public boolean verify ()
    {
        Vector<String> input = Util.readMap(EXAMPLE1_FILE);
        Map theMap = new Map(input, _debug);

        System.out.println(theMap);

        Explorer exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: "+theMap.numberOfKeys()+", "+theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");
        
        int steps = exp.findAllKeys();

        if (steps == EXAMPLE1_STEPS)
        {
            System.out.println("Verified. Number of steps to find all keys: "+steps);

            input = Util.readMap(EXAMPLE2_FILE);

            theMap = new Map(input, _debug);

            System.out.println("\n"+theMap);

            exp = new Explorer(theMap, _debug);

            System.out.println("Number of keys and doors: "+theMap.numberOfKeys()+", "+theMap.numberOfDoors());

            System.out.println("\nTraversing map ...");

            steps = exp.findAllKeys();

            if (steps == EXAMPLE2_STEPS)
            {
                System.out.println("Verified. Number of steps to find all keys: "+steps);
            }
            else
                System.out.println("Error for "+EXAMPLE2_FILE+" - number of steps: "+steps);
        }
        else
            System.out.println("Error for "+EXAMPLE1_FILE+" - number of steps: "+steps);
        
        return false;
    }

    private boolean _debug;
}
@@ -1140,33 +1140,33 @@
       if (steps 
-=
+!
 = EXAMPLE1_STEPS
@@ -1173,32 +1173,155 @@
 )%0A        %7B%0A    
+        System.out.println(%22Error for %22+EXAMPLE1_FILE+%22 - number of steps: %22+steps);%0A%0A            return false;%0A        %7D%0A%0A
         System.o
@@ -1395,20 +1395,16 @@
         
-  
-  
 input = 
@@ -1429,28 +1429,24 @@
 LE2_FILE);%0A%0A
-    
         theM
@@ -1475,36 +1475,32 @@
 ebug);%0A%0A        
-    
 System.out.print
@@ -1525,20 +1525,16 @@
         
- 
-   
 exp = ne
@@ -1558,28 +1558,24 @@
 , _debug);%0A%0A
-    
         Syst
@@ -1671,36 +1671,32 @@
 rs());%0A%0A        
-    
 System.out.print
@@ -1732,20 +1732,16 @@
         
- 
-   
 steps = 
@@ -1764,28 +1764,24 @@
 );%0A%0A        
-   
- 
 if (steps ==
@@ -1778,17 +1778,17 @@
  (steps 
-=
+!
 = EXAMPL
@@ -1801,38 +1801,38 @@
 PS)%0A        
+%7B%0A
     
-%7B%0A
         
         Syst
@@ -1811,32 +1811,147 @@
   %7B%0A            
+System.out.println(%22Error for %22+EXAMPLE2_FILE+%22 - number of steps: %22+steps);%0A%0A            return false;%0A        %7D%0A%0A
         System.o
@@ -2028,132 +2028,390 @@
     
+%0A
     
-%7D%0A            else%0A                System.out.println(%22Error for %22+EXAMPLE2_FILE+%22 - number of steps: %22+steps
+    input = Util.readMap(EXAMPLE3_FILE);%0A%0A        theMap = new Map(input, _debug);%0A%0A        System.out.println(%22%5Cn%22+theMap);%0A%0A        exp = new Explorer(theMap, _debug);%0A%0A        System.out.println(%22Number of keys and doors: %22+theMap.numberOfKeys()+%22, %22+theMap.numberOfDoors());%0A%0A        System.out.println(%22%5CnTraversing map ...%22);%0A%0A        steps = exp.findAllKeys(
 );%0A
+%0A
         
 %7D%0A  
@@ -2406,17 +2406,44 @@
         
-%7D
+if (steps != EXAMPLE3_STEPS)
 %0A       
@@ -2447,12 +2447,9 @@
     
-else
+%7B
 %0A   
@@ -2488,33 +2488,33 @@
 or for %22+EXAMPLE
-1
+3
 _FILE+%22 - number
@@ -2530,32 +2530,33 @@
 : %22+steps);%0A
+%0A
         
 %0A        ret
@@ -2539,29 +2539,24 @@
 );%0A%0A        
-%0A    
     return f
@@ -2554,24 +2554,139 @@
  return fals
+e;%0A        %7D%0A%0A        System.out.println(%22Verified. Number of steps to find all keys: %22+steps);%0A%0A        return tru
 e;%0A    %7D%0A%0A  

Update Verifier.java