Adding Alpha Beta pruning to Negamax in Java
问题 I am making a chess game in Java and (I think) have successfully implemented Negamax for the AI player. I am having some trouble adding alpha beta pruning to this to improve the algorithm. I have tried following tutorials and example code but just can't get my head around how it works. Below is the code I currently have to get the best move: private Move getBestMove() { System.out.println("Getting best move"); System.out.println("Thinking..."); List<Move> validMoves = generateMoves(true); int