import java.io.*;

public class TestPlotter
{
    public static final String SEPARATOR = ",";

    public static final char UP = 'U';
    public static final char DOWN = 'D';
    public static final char LEFT = 'L';
    public static final char RIGHT = 'R';

    /*
     * Assume the starting point is in the middle of the
     * 2d array. But how big should the array be to ensure
     * we don't run out of space or over the edges?
     * 
     * We take a guess at the moment but could create an
     * iterative program to dynamically assess the minimum
     * size needed.
     */

    public static final int LENGTH = 1000;
    public static final int WIDTH = 1000;

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

        for (int i = 0; i < args.length; i++)
        {
            if ("-help".equals(args[i]))
            {
                System.out.println("[-help] [-debug]");
                System.exit(0);
            }

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

        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;
        String[] line1 = null;
        String[] line2 = null;

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

            while ((line = reader.readLine()) != null)
            {
                if (line1 == null)
                    line1 = line.split(SEPARATOR);
                else
                {
                    if (line2 == null)
                        line2 = line.split(SEPARATOR);
                    else
                    {
                        System.out.println("Unexpected extra lines in input file!");

                        System.exit(0);
                    }
                }
            }

            if (debug)
                dumpData(line1, line2);
            else
            {
                if (checkMatrixSize(line1) && checkMatrixSize(line2))
                {
                    System.out.println("Matrix of "+LENGTH+" and "+WIDTH+" is sufficient.");
                }
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }
    }

    private static final boolean checkMatrixSize (String[] line)
    {
        int xPos = LENGTH/2;
        int yPos = WIDTH/2;

        for (String str : line)
        {
            switch (str.charAt(0))
            {
                case TestPlotter.LEFT:
                {
                    xPos -= Integer.parseInt(str.substring(1));

                    if (xPos < 0)
                    {
                        System.out.println("Instruction "+str+" moved x pointer to "+xPos);

                        return false;
                    }
                }
                break;
                case TestPlotter.RIGHT:
                {
                    xPos += Integer.parseInt(str.substring(1));

                    if (xPos > LENGTH)
                    {
                        System.out.println("Instruction "+str+" moved x pointer to "+xPos);

                        return false;
                    }
                }
                break;
                case TestPlotter.UP:
                {
                    yPos += Integer.parseInt(str.substring(1));

                    if (yPos > WIDTH)
                    {
                        System.out.println("Instruction "+str+" moved y pointer to "+yPos);

                        return false;
                    }
                }
                break;
                case TestPlotter.DOWN:
                {
                    yPos -= Integer.parseInt(str.substring(1));

                    if (yPos < 0)
                    {
                        System.out.println("Instruction "+str+" moved y pointer to "+yPos);

                        return false;
                    }
                }
                break;
                default:
                {
                    System.out.println("Unknown instruction: "+str.charAt(0));

                    return false;
                }
            }
        }

        return true;
    }

    private static final void dumpData (String[] line1, String[] line2)
    {
        System.out.println("Wire 1:");
        for (String str : line1)
        {
            System.out.println(str);
        }

        System.out.println("\nWire 2:");
        for (String str : line2)
        {
            System.out.println(str);
        }
    }

    private static final String DATA_FILE = "data.txt";
}
@@ -608,16 +608,24 @@
 nal int 
+DEFAULT_
 LENGTH =
@@ -659,16 +659,24 @@
 nal int 
+DEFAULT_
 WIDTH = 
@@ -927,16 +927,52 @@
 %5B-debug%5D
+ %5B-width %3Cwidth%3E%5D %5B-length %3Clength%3E%5D
 %22);%0A    
@@ -1081,24 +1081,220 @@
 ebug = true;
+%0A%0A            if (%22-width%22.equals(args%5Bi%5D))%0A                _width = Integer.parseInt(args%5Bi+1%5D);%0A%0A            if (%22-length%22.equals(args%5Bi%5D))%0A                _length = Integer.parseInt(args%5Bi+1%5D);
 %0A        %7D%0A%0A
@@ -2337,22 +2337,23 @@
 ix of %22+
-LENGTH
+_length
 +%22 and %22
@@ -2353,21 +2353,22 @@
 %22 and %22+
-WIDTH
+_width
 +%22 is su
@@ -2775,22 +2775,23 @@
  xPos = 
-LENGTH
+_length
 /2;%0A    
@@ -2805,21 +2805,22 @@
  yPos = 
-WIDTH
+_width
 /2;%0A%0A   
@@ -3433,22 +3433,23 @@
 (xPos %3E 
-LENGTH
+_length
 )%0A      
@@ -3809,21 +3809,22 @@
 (yPos %3E 
-WIDTH
+_width
 )%0A      
@@ -4964,39 +4964,136 @@
 str);%0A        %7D%0A
-
     %7D%0A%0A
+    private static int _length = DEFAULT_LENGTH;%0A    private static int _width = DEFAULT_WIDTH;%0A%0A
     private stat

Update TestPlotter.java