ALPHA-BETA(state, player, depth, alpha,
beta)
/* If the level is the top level, let alpha = -infinity, beta = +infinity If state is a terminal state, or if depth has
reached the search limit: If player is MAX: Until all of state's children are examined with
ALPHA-BETA or until
Call ALPHA-BETA(child, MIN, depth+1, alpha, beta)
Compare the value reported to alpha; if reported value
Return largest value reported If player is MIN: Until all of state's children are examined with
ALPHA-BETA or until
Call ALPHA-BETA(child, MAX, depth+1, alpha, beta)
Compare the value reported to beta; if reported value
Return smallest value reported
|