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

public class Map
{
    public Map (String fileToLoad, boolean debug)
    {
        _theMap = new Vector<MapElement>();
        _debug = debug;

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

    @Override
    public String toString ()
    {
        Enumeration<MapElement> iter = _theMap.elements();
        String str = "";

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

            str += theEntry.type();

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

        return str;
    }

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

        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 Vector<MapElement> _theMap;
    private int _height = 0;
    private int _width = 0;
    private boolean _debug;
}
@@ -335,32 +335,125 @@
 String ()%0A    %7B%0A
+        if (_debug)%0A            System.out.println(%22Dimensions %3C%22+_width+%22, %22+_height+%22%3E%22);%0A%0A
         Enumerat
@@ -658,24 +658,78 @@
 ry.type();%0A%0A
+            System.out.println(theEntry.position());%0A%0A
             
@@ -768,16 +768,19 @@
 = _width
+ -1
 )%0A      

Update Map.java