import java.util.*;

public class Tunnel
{
    public static final String TUNNEL_DATA = "tunnel.txt";

    public static final void main (String[] args)
    {
        String dataFile = TUNNEL_DATA;
        boolean debug = false;
        boolean verify = false;

        for (int i = 0; i < args.length; i++)
        {
            if ("-help".equals(args[i]))
            {
                System.out.println("Usage: [-data <file>] [-verify] [-debug] [-help]");
                System.exit(0);
            }
            
            if ("-data".equals(args[i]))
                dataFile = args[i+1];

            if ("-debug".equals(args[i]))
                debug = true;

            if ("-verify".equals(args[i]))
                verify = true;
        }

        if (verify)
        {
            Verifier theVerifier = new Verifier(debug);

            if (theVerifier.verify())
                System.out.println("Verified ok.");
            else
                System.out.println("Verify failed.");
        }
        else
        {
            Vector<String> input = Util.readMap(TUNNEL_DATA);
            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();

            System.out.println("Verified. Number of steps to find all keys: "+steps);
        }
    }
}
@@ -33,17 +33,17 @@
 s Tunnel
-%0A
+ 
 %7B%0A    pu
@@ -129,17 +129,16 @@
 oid main
- 
 (String%5B
@@ -144,20 +144,16 @@
 %5B%5D args)
-%0A   
  %7B%0A     
@@ -295,24 +295,16 @@
 th; i++)
-%0A       
  %7B%0A     
@@ -338,28 +338,16 @@
 rgs%5Bi%5D))
-%0A           
  %7B%0A     
@@ -475,29 +475,17 @@
       %7D%0A
-            
 %0A
+
         
@@ -550,17 +550,19 @@
 = args%5Bi
-+
+ + 
 1%5D;%0A%0A   
@@ -735,24 +735,16 @@
 (verify)
-%0A       
  %7B%0A     
@@ -960,30 +960,36 @@
 %22);%0A
- 
+%0A
        
-%7D%0A
      
-   else
+System.exit(0);
 %0A   
@@ -993,16 +993,23 @@
         
+%7D else 
 %7B%0A      
@@ -1153,21 +1153,17 @@
 heMap);%0A
-    
 %0A
+
         
@@ -1210,20 +1210,16 @@
 debug);%0A
-    
 %0A       
@@ -1270,17 +1270,19 @@
 doors: %22
-+
+ + 
 theMap.n
@@ -1298,14 +1298,18 @@
 ys()
-+
+ + 
 %22, %22
-+
+ + 
 theM
@@ -1329,20 +1329,16 @@
 ors());%0A
-    
 %0A       
@@ -1390,21 +1390,9 @@
 %22);%0A
-            
 %0A
+
     
@@ -1508,17 +1508,19 @@
  keys: %22
-+
+ + 
 steps);%0A

Update Tunnel.java