chess:programming:minimax_algorithm
This is an old revision of the document!
Chess - Programming - Minimax Algorithm
Minmax considers all the possible ways the game can go and returns the best value for that move, assuming the opponent also plays optimally.
A program to illustrate the Minimax Algorithm
Pseudocode
function minimax(board, depth, isMaximizingPlayer): if current board state is a terminal state : return value of the board if isMaximizingPlayer : bestVal = -INFINITY for each move in board : value = minimax(board, depth+1, false) bestVal = max( bestVal, value) return bestVal else : bestVal = +INFINITY for each move in board : value = minimax(board, depth+1, true) bestVal = min( bestVal, value) return bestVal
chess/programming/minimax_algorithm.1635631146.txt.gz · Last modified: 2021/10/30 21:59 by peter