import java.util.*;
import java.io.*;

public class Map
{
    public Map (String fileToLoad, boolean debug)
    {
        _theMap = null;
        _debug = debug;

        if (!loadData(fileToLoad))
            System.out.println("Error in loading data file: "+fileToLoad);
    }

    public Map (Map theCopy)
    {
        _theMap = new Vector<MapElement>();
        _debug = theCopy._debug;

        Enumeration<MapElement> iter = theCopy._theMap.elements();

        while (iter.hasMoreElements())
        {
            MapElement element = iter.nextElement();
            
            _theMap.add(new MapElement(element));
        }
    }

    @Override
    public String toString ()
    {
        if (_debug)
            System.out.println("Dimensions <"+_theMap[0].length+", "+_theMap.length+">");

        Enumeration<MapElement> iter = _theMap.elements();
        String str = "";

        while (iter.hasMoreElements())
        {
            MapElement theEntry = iter.nextElement();

            str += theEntry.type();

            System.out.println(theEntry.position());

            if (theEntry.position().getX() == _width -1)
                str += "\n";
        }

        return str;
    }

    private final boolean loadData (String file)
    {
        BufferedReader reader = null;
        boolean valid = true;
        int width = 0;
        int height = 0;

        try
        {
            reader = new BufferedReader(new FileReader(file));
            String line = null;

            while ((line = reader.readLine()) != null)
            {
                char[] asChar = line.toCharArray();
                
                if (_width == 0)
                    _width = asChar.length;

                for (int i = 0; i < _width; i++)
                {
                    // remember x,y coords are reversed for arrays
                    
                    if (asChar[i] == MapElement.TREE)
                    {
                        _theMap.add(new MapElement(new Coordinate(i, _height), MapElement.TREE));
                    }
                    else
                    {
                        if (asChar[i] == MapElement.OPEN)
                        {
                            _theMap.add(new MapElement(new Coordinate(i, _height), MapElement.OPEN));
                        }
                        else
                        {
                            System.out.println("Unknown character in data file: "+asChar[i]);

                            valid = false;
                        }
                    }
                }

                _height++;
            }
        }
        catch (Throwable ex)
        {
            valid = false;

            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }

        return valid;
    }

    private final char[][] toCharArray (Vector<MapElement> map, int width, int height)
    {
        char[][] toReturn = new char[width][height];
        Enumeration<MapElement> iter = map.elements();

        while (iter.hasMoreElements())
        {
            MapElement element = iter.nextElement();

            toReturn[element.position().getX()][element.position().getY()] = element.type();
        }

        return toReturn;
    }
    
    private char[][] _theMap;
    private boolean _debug;
}
@@ -809,67 +809,34 @@
     
-Enumeration%3CMapElement%3E iter = _theMap.elements()
+String str = %22%22
 ;%0A
+%0A
         
 Stri
@@ -835,63 +835,50 @@
     
-String str = %22%22;%0A%0A        while (iter.hasMoreElements()
+for (int x = 0; x %3C _theMap%5B0%5D.length; x++
 )%0A  
@@ -901,203 +901,116 @@
     
-MapElement theEntr
+for (int 
 y = 
-iter.nextElement();%0A%0A            str += theEntry.type();%0A%0A            System.out.println(theEntry.position());%0A%0A            if (theEntry.position().getX() == _width -1)%0A    
+0; y %3C _theMap.length; y++)%0A            %7B%0A                str += _theMap%5Bx%5D%5By%5D;%0A            %7D%0A%0A
     
@@ -1086,23 +1086,20 @@
 e final 
-boolean
+void
  loadDat
@@ -1162,38 +1162,8 @@
 ll;%0A
-        boolean valid = true;%0A
     
@@ -1204,16 +1204,75 @@
 ght = 0;
+%0A        Vector%3CMapElement%3E map = new Vector%3CMapElement%3E();
 %0A%0A      
@@ -1541,17 +1541,16 @@
     if (
-_
 width ==
@@ -1573,17 +1573,16 @@
         
-_
 width = 
@@ -1633,17 +1633,16 @@
  0; i %3C 
-_
 width; i
@@ -1843,37 +1843,33 @@
                 
-_theM
+m
 ap.add(new MapEl
@@ -1884,33 +1884,32 @@
 w Coordinate(i, 
-_
 height), MapElem
@@ -2093,37 +2093,33 @@
                 
-_theM
+m
 ap.add(new MapEl
@@ -2142,17 +2142,16 @@
 nate(i, 
-_
 height),
@@ -2472,17 +2472,16 @@
         
-_
 height++
@@ -2549,36 +2549,8 @@
   %7B%0A
-            valid = false;%0A%0A
     
@@ -2775,20 +2775,49 @@
     
-return valid
+_theMap = toCharArray(map, width, height)
 ;%0A  

Update Map.java