Negascout - Pseudocode

Pseudocode

function pvs(node, depth, α, β, color) if node is a terminal node or depth = 0 return color * the heuristic value of node b := β (* initial window is (-β, -α) *) foreach child of node score := -pvs (child, depth - 1, -b, -α, -color) if α < score < β and child is not first child (* check if null-window failed high *) score := -pvs(child, depth - 1, -β, -α, -color) (* full re-search *) α := max(α, score) if α ≥ β return α (* Beta cut-off *) b := α + 1 (* set new null window *) return α

Read more about this topic:  Negascout