import java.util.*;

public class Scaffold
{
    public static final String SCAFFOLDING = "#";
    public static final String OPEN_SPACE = ".";

    // ASCII codes.

    public static final String SCAFFOLDING_CODE = "35";
    public static final String OPEN_SPACE_CODE = "46";
    public static final String NEW_LINE_CODE = "10";

    public Scaffold (boolean debug)
    {
        _image = new Vector<String>();
        _debug = debug;
    }

    public void addData (String value)
    {
        if ((SCAFFOLDING_CODE.equals(value)) || (OPEN_SPACE_CODE.equals(value)) || (NEW_LINE_CODE.equals(value)))
            _image.add(value);
        else
        {
            if (VacuumRobot.isRobotCode(value))
                _image.add(value);
            else
            {
                if (_debug)
                    System.out.println("Invalid code: "+value);
            }
        }
    }

    public void scanForIntersections ()
    {
        
    }

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

        while (iter.hasMoreElements())
        {
            String val = iter.nextElement();

            switch (val)
            {
                case SCAFFOLDING_CODE:
                {
                    str += SCAFFOLDING;
                }
                break;
                case OPEN_SPACE_CODE:
                {
                    str += OPEN_SPACE;
                }
                break;
                case NEW_LINE_CODE:
                {
                    str += "\n";
                }
                break;
                default:
                    str += VacuumRobot.print(val);
            }
        }

        return str;
    }

    private Vector<String> _image;
    private boolean _debug;
}
@@ -401,24 +401,52 @@
 %3CString%3E();%0A
+        _numberOfLines = 0;%0A
         _deb
@@ -457,16 +457,16 @@
  debug;%0A
-
     %7D%0A%0A 
@@ -623,16 +623,26 @@
 alue)))%0A
+        %7B%0A
         
@@ -655,32 +655,122 @@
 mage.add(value);
+%0A%0A            if (NEW_LINE_CODE.equals(value))%0A                _numberOfLines++;%0A        %7D
 %0A        else%0A  
@@ -1060,24 +1060,16 @@
 )%0A    %7B%0A
-        
 %0A    %7D%0A%0A
@@ -1897,16 +1897,48 @@
 _image;%0A
+    private int _numberOfLines;%0A
     priv

Update Scaffold.java