Негамакс - игрок ходит дважды

Как вы ведете игры, в которых, если выполняется условие, тот же игрок движется?

Я пробовал что-то вроде этого, но не думаю, что это совсем правильно:

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 α
5
задан John Retallack 7 January 2012 в 20:56
поделиться