public static void execute(int[] pattern)
    {
        int a = 0, b=0, c=0;

        for (int i = 0; i < pattern.length; i++) {
            switch (pattern[i]) {
            case (1):
                r2 = b;
                break;
            case (2):
                r1 = a;
                //c = 1;
                break;
            case (3):
                //r1 = a;
                c = 1;
                //System.out.print("  r1 = "+ r1+"  r2= "+r2);
                break;
            case (4):
                //a =1;
                r3 = c;
                break;
            case (5):
                a= 1;
                //r3 =c;
                break;
            case(6):
                b =1;
                //System.out.print("  r3= "+r3);
                break;
            }
        }
    }