public int findMove(int index, int offset, int player) {
        int nextIndex = index + offset;
        if (indexIsOutOfBounds(nextIndex)) return INVALIDMOVE;
        else if (boardArray[nextIndex] == OPEN) return nextIndex;
        else if (boardArray[nextIndex] == opponent(player))
            return findMove(nextIndex, offset, player);
        else return INVALIDMOVE;
    }