条件が満たされた場合に同じプレイヤーが移動するゲームをどのように処理しますか?
私はこのようなことを試みましたが、それは完全に正しいとは思いません:
function negamax(node, depth, α, β, color)
if node is a terminal node or depth = 0
return color * the heuristic value of node
else
foreach child of node
if (condition is met) // the same player moves
val := negamax(child, depth-1, α, β, color)
else
val := -negamax(child, depth-1, -β, -α, -color)
if val≥β
return val
if val≥α
α:=val
return α