public int max(Move move, int depth, boolean first) {
        if (depth == 0)
            return move.getScore();

        Move v[] = move.generateMoves();
        int score = Integer.MIN_VALUE;
        for (int i = 0; i < v.length; i++) {
            score = Math.max(score, min(v[i], depth - 1));

            if (first && bestScore < score) {
                bestScore = score;
                bestMove = v[i];
            }
        }//for
        return score;
    }//max()