5

条件が満たされた場合に同じプレイヤーが移動するゲームをどのように処理しますか?

私はこのようなことを試みましたが、それは完全に正しいとは思いません:

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 α
4

3 に答える 3

0

条件が満たされた場合、深さを減らさないでください。

于 2012-03-25T14:35:38.687 に答える