private static void move(int p, int s, int f) {
        int start  = s;
        int finish = f;
        int loops  = (finish - start) / 13;
        int skip;

        if (p == 0) {

            skip = 13;

            if (finish == 13) { finish++; }

            if (finish <= 12) {

                fillBeans(start + 1, finish);

            } else {

                fillBeans(start + 1, 12);

                while (loops > 0) {

                    fillBeans(0, 12);
                    loops--;

                }

                fillBeans(0, finish % 13);

            }

        } else {

            skip = 6;

            if (finish % 13 == 6) { finish++; }

            if (finish <= 13) {

                fillBeans(start + 1, finish);

            } else {

                fillBeans(start + 1, 13);

                while (loops > 0) {

                    fillBeans(0, 5);
                    fillBeans(7, 13);
                    loops--;

                }

                if (finish % 13 < 6) {

                    fillBeans(0, finish % 13 - 1);

                } else {

                    fillBeans(0, 5);
                    fillBeans(7, finish % 13);

                }

            }

        }

        board[start] = 0;
    }