diff --git a/NineChess/src/aithread.cpp b/NineChess/src/aithread.cpp index 6b0d36d4..d93c3fca 100644 --- a/NineChess/src/aithread.cpp +++ b/NineChess/src/aithread.cpp @@ -71,13 +71,9 @@ void AiThread::run() emit calcStarted(); mutex.unlock(); -// if ((chess_.getContext()) & (NineChess::GAME_MOVING)) { -// setAi(*chess_, 12, 99); -// } - ai_ab.alphaBetaPruning(aiDepth); const char *str = ai_ab.bestMove(); - qDebug() << "Depth:" << aiDepth << " Computer:" << str << "\n"; + qDebug() << "Computer:" << str << "\n"; if (strcmp(str, "error!")) emit command(str); #ifdef DEBUG diff --git a/NineChess/src/ninechessai_ab.cpp b/NineChess/src/ninechessai_ab.cpp index 30853220..c4ad0ae1 100644 --- a/NineChess/src/ninechessai_ab.cpp +++ b/NineChess/src/ninechessai_ab.cpp @@ -246,6 +246,13 @@ int NineChessAi_ab::evaluate(Node *node) int NineChessAi_ab::alphaBetaPruning(int depth) { + // 走棋阶段将深度调整为 10 + if ((chessTemp.context.stage) & (NineChess::GAME_MOVING)) { + depth = 10; + } + + qDebug() << "Depth:" << depth; + return alphaBetaPruning(depth, -infinity, infinity, rootNode); }