From 11916ae98b09786734bcc33d0a4b76c76e051b57 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sat, 11 Jul 2020 18:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20AIAlgorithm=20=E4=B8=AD?= =?UTF-8?q?=E7=A9=BA=E7=9D=80=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/search.cpp | 33 --------------------------------- src/search.h | 3 --- 2 files changed, 36 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 377aec6d..f2f7b423 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -415,29 +415,6 @@ Value AIAlgorithm::search(Depth depth, Value alpha, Value beta) bestValue -= depth; } -#ifdef NULL_MOVE - if (depth % 2 == 1) - { - // TODO: WIP - st->generateNullMove(moves); - st->generateChildren(moves, this, node); - do_null_move(); - int moveCount = st->generate(moves); - if (moveCount) - { - st->generateChildren(moves, this, node->children[0]); - value = -search(depth - 1 - 2, -beta, -beta + 1, node->children[0]); - undo_null_move(); - - if (value >= beta) { - bestValue = beta; - return beta; - } - } - - } -#endif - #ifdef TRANSPOSITION_TABLE_ENABLE TranspositionTable::save(bestValue, depth, @@ -583,16 +560,6 @@ void AIAlgorithm::undo_move() positionStack.pop(); } -void AIAlgorithm::do_null_move() -{ - pos->do_null_move(); -} - -void AIAlgorithm::undo_null_move() -{ - pos->undo_null_move(); -} - #ifdef ALPHABETA_AI const char* AIAlgorithm::nextMove() { diff --git a/src/search.h b/src/search.h index af7b4fee..0c1f2ddb 100644 --- a/src/search.h +++ b/src/search.h @@ -168,9 +168,6 @@ public: void undo_move(); - void do_null_move(); - void undo_null_move(); - #ifdef TRANSPOSITION_TABLE_ENABLE void clearTT(); #endif