public class Compute
{
    public static final int[] BASE_PATTERN = {0, 1, 0, -1};

    public Compute (boolean debug)
    {
        _debug = debug;
    }

    public int[] process (int[] input, int numberOfPhases)
    {
        int[] results = input;

        for (int i = 0; i < numberOfPhases; i++)
        {
            results = processPhase(input);

            //phaseInput = results;
        }

        return results;
    }

    private int[] processPhase (int[] input)
    {
        int[] results = new int[input.length];
        int basePatternIndex = 0;
        int basePatternLowerBounds = 1;

        for (int i = 0; i < input.length; i++)
        {
            int value = 0;

            for (int j = 0; j < input.length; j++)
            {
                int[] work = new int[input.length];

                work[j] = input[j] * BASE_PATTERN[basePatternIndex];

                System.out.println(input[j]+"*"+BASE_PATTERN[basePatternIndex]);
                
                basePatternIndex++;

                if (basePatternIndex == BASE_PATTERN.length)
                    basePatternIndex = basePatternLowerBounds;

                value += work[j];
            }

            results[i] = value;
        }

        return results;
    }

    boolean _debug;
}
@@ -423,24 +423,295 @@
 lts;%0A    %7D%0A%0A
+    /*%0A     * 10-1010-10%0A     * 01100-1-10%0A     * 00111000%0A     * 00011110%0A     * 00001111%0A     * 00000111%0A     * 00000011%0A     * 00000001%0A     * %0A     * 010-1%0A     * 001100-1-1%0A     * 000111000-1-1-1%0A     * 000011110000-1-1-1-1%0A     * 000001111100000-1-1-1-1-1%0A     */%0A%0A
     private 
@@ -743,16 +743,16 @@
  input)%0A
-
     %7B%0A  
@@ -830,16 +830,49 @@
 ex = 0;%0A
+        int basePatternLoop = 1;%0A
         
@@ -1106,16 +1106,79 @@
 ength%5D;%0A
+                int pattern = BASE_PATTERN%5BbasePatternIndex%5D;%0A%0A
 %0A       
@@ -1321,32 +1321,16 @@
 ndex%5D);%0A
-                
 %0A       

Update Compute.java