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 = "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.equals(value)))
            _image.add(value);
        else
        {
            if (_debug)
                System.out.println("Invalid code: "+value);
        }
    }

    @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;
                default:
                    str += "\n";
            }
        }

        return str;
    }

    private Vector<String> _image;
    private boolean _debug;
}
@@ -309,16 +309,21 @@
 NEW_LINE
+_CODE
  = %2210%22;
@@ -573,16 +573,21 @@
 NEW_LINE
+_CODE
 .equals(
@@ -641,32 +641,150 @@
  else%0A        %7B%0A
+            if (VacuumRobot.isRobotCode(value))%0A                _image.add(value);%0A            else%0A            %7B%0A    
             if (
@@ -787,24 +787,28 @@
 if (_debug)%0A
+    
             
@@ -847,32 +847,46 @@
 code: %22+value);%0A
+            %7D%0A
         %7D%0A    %7D%0A
@@ -1416,32 +1416,160 @@
          break;%0A
+                case NEW_LINE_CODE:%0A                %7B%0A                    str += %22%5Cn%22;%0A                %7D%0A                break;%0A
                 
@@ -1596,36 +1596,54 @@
          str += 
-%22%5Cn%22
+VacuumRobot.print(val)
 ;%0A            %7D%0A

Update Scaffold.java