endgame: 搜索到必胜值再加上层数且修复缺少 break 的问题
This commit is contained in:
parent
cf2fdb360b
commit
671882c760
|
@ -418,8 +418,12 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
|
|||
switch (endgame.type) {
|
||||
case ENDGAME_PLAYER_1_WIN:
|
||||
node->value = VALUE_WIN;
|
||||
node->value += depth;
|
||||
break;
|
||||
case ENDGAME_PLAYER_2_WIN:
|
||||
node->value = -VALUE_WIN;
|
||||
node->value -= depth;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue