public ArrayList<Integer> findLegalMoves(int startIndex, int player, ArrayList<Integer> moves) {
        for (int offset : getOffsets()) {
            int move = findMove(startIndex, offset, player);
            if (move != INVALIDMOVE && !adjacentMove(startIndex, offset, move) && !moves.contains(move))
                moves.add(move);
        }
        return moves;
    }