alphaBetaSearch
alphaBetaSearch<
S,M,P>(game,state,options):AlphaBetaResult<M>
Defined in: src/modules/game-search/alpha-beta.ts:101
Looks ahead with iterative-deepening minimax and alpha-beta pruning and
returns the best move for the player to move in state.
It searches one move deeper each round until the budget runs out or the game tree is exhausted, and returns the best move of the last finished round. The first round always finishes, so a legal move comes back whenever one exists. Every other player is assumed to play against the root player, which also covers moves that leave the same player to move.
Throws when a budget option is negative or not a number.
Type Parameters
Section titled “Type Parameters”S
M
P = number
Parameters
Section titled “Parameters”SearchGame<S, M, P>
S
options
Section titled “options”AlphaBetaOptions<S, P>