diff --git a/src/ai/movegen.cpp b/src/ai/movegen.cpp index f4df48b3..c31c8c18 100644 --- a/src/ai/movegen.cpp +++ b/src/ai/movegen.cpp @@ -333,7 +333,7 @@ void MoveList::create() #ifdef DEBUG_MODE int sum = 0; - for (int i = 0; i < Board::N_LOCATIONS; i++) { + for (int i = 0; i < SQ_EXPANDED_COUNT; i++) { loggerDebug("/* %d */ {", i); for (int j = 0; j < DIRECTIONS_COUNT; j++) { if (j == DIRECTIONS_COUNT - 1) diff --git a/src/ai/search.cpp b/src/ai/search.cpp index c4370393..bfcf8895 100644 --- a/src/ai/search.cpp +++ b/src/ai/search.cpp @@ -201,19 +201,19 @@ struct AIAlgorithm::Node *AIAlgorithm::addNode( char cmd[32] = { 0 }; if (move < 0) { - tempGame.position.board.squareToPolar(-move, r, s); + tempGame.position.board.squareToPolar(static_cast(-move), r, s); sprintf(cmd, "-(%1u,%1u)", r, s); } else if (move & 0x7f00) { int r1, s1; - tempGame.position.board.squareToPolar(move >> 8, r1, s1); - tempGame.position.board.squareToPolar(move & 0x00ff, r, s); + tempGame.position.board.squareToPolar(static_cast(move >> 8), r1, s1); + tempGame.position.board.squareToPolar(static_cast(move & 0x00ff), r, s); sprintf(cmd, "(%1u,%1u)->(%1u,%1u)", r1, s1, r, s); } else { - tempGame.position.board.squareToPolar(move & 0x007f, r, s); + tempGame.position.board.squareToPolar(static_cast(move & 0x007f), r, s); sprintf(cmd, "(%1u,%1u)", r, s); } - newNode->cmd = cmd; + strcpy(newNode->cmd, cmd); #endif // DEBUG_AB_TREE if (parent) { diff --git a/src/ai/search.h b/src/ai/search.h index 40e76fb8..b97a3d0d 100644 --- a/src/ai/search.h +++ b/src/ai/search.h @@ -76,7 +76,7 @@ public: #ifdef DEBUG_AB_TREE size_t id; // 结点编号 - string cmd; + char cmd[32]; int depth; // 深度 bool evaluated; // 是否评估过局面 int alpha; // 当前搜索结点走棋方搜索到的最好值,任何比它小的值对当前结点的走棋方都没有意义。当函数递归时 Alpha 和 Beta 不但取负数而且要交换位置