-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Julian Roth edited this page Nov 15, 2018
·
2 revisions
function alphabeta(node, depth, α, β, maximizingPlayer) is if depth = 0 or node is a terminal node then return the heuristic value of node if maximizingPlayer then value := −∞ for each child of node do value := max(value, alphabeta(child, depth − 1, α, β, FALSE)) α := max(α, value) if α ≥ β then break (* β cut-off *) return value else value := +∞ for each child of node do value := min(value, alphabeta(child, depth − 1, α, β, TRUE)) β := min(β, value) if α ≥ β then break (* α cut-off *) return value
source: Wikipedia: Alpha-beta pruning