public M best(final G game,final IMoveGenerator<M,G> generator,int depthmax) throws TimeoutException {
  try {
    this.depthmax=depthmax;
    final MinMaxEvaluatedMove best=minimax(game,generator,depthmax,Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY,game.currentPlayer() == 0,killer);
    killer=best;
    return best.getMove();
  }
 catch (  final AlphaBetaPrunningException e) {
    throw new RuntimeException("evaluated move found with value not between + infinity and - infinity...");
  }
}

public M best ( final G game , final IMoveGenerator < M , G > generator , int depthmax ) throws TimeoutException { try { this . depthmax = depthmax ; final MinMaxEvaluatedMove best = minimax ( game , generator , depthmax , Double . NEGATIVE_INFINITY , Double . POSITIVE_INFINITY , game . currentPlayer ( ) == 0 , killer ) ; killer = best ; return best . getMove ( ) ; } catch ( final AlphaBetaPrunningException e ) { throw new RuntimeException ( "evaluated move found with value not between + infinity and - infinity..." ) ; } }
search in the game tree the best move using minimax with alpha beta pruning
