diff --git a/cpp/src/main.cpp b/cpp/src/main.cpp index 9a821e1..f2d798c 100644 --- a/cpp/src/main.cpp +++ b/cpp/src/main.cpp @@ -11,26 +11,26 @@ #include int main(int argc, char* argv[]) { - std::string pos = - "r2qkb1r/2p1pppp/p1n1b3/1p6/B2P4/2P1P3/P4PPP/R1BQK1NR w KQkq - 0 9 "; + // std::string pos = + // "r2qkb1r/2p1pppp/p1n1b3/1p6/B2P4/2P1P3/P4PPP/R1BQK1NR w KQkq - 0 9 "; // std::string pos = "8/6K1/5P2/8/1k6/8/8/8 w - - 0 1"; // pos for ai timing< - // std::string pos = - // "r3k2r/p1ppqpb1/Bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPB1PPP/R3K2R b KQkq - - // 0 3 "; + std::string pos = + "r3k2r/p1ppqpb1/Bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPB1PPP/R3K2R b KQkq - 0 3"; Board b = Board::setup_fen_position(pos); ai::v0_random p1(true, std::chrono::milliseconds(1000)); // ai::v1_pure_minimax p2(false, std::chrono::milliseconds(20000)); // ai::v2_alpha_beta p2(false, std::chrono::milliseconds(20000)); - // ai::v3_AB_ordering p2(false, std::chrono::milliseconds(20000)); - ai::v4_search_captures p2(false, std::chrono::milliseconds(20000)); + ai::v3_AB_ordering p2(false, std::chrono::milliseconds(20000)); + // ai::v4_search_captures p2(false, std::chrono::milliseconds(20000)); - GUI gui; - // AIvsAIController manual(b, gui, p1, p2); - HumanVsAIController manual(b, gui, p2); + // GUI gui; + NoOpView gui; + AIvsAIController manual(b, gui, p1, p2); + // HumanVsAIController manual(b, gui, p2); Controller& controller = manual; diff --git a/cpp/src/model/ais/v1_pure_minimax.cpp b/cpp/src/model/ais/v1_pure_minimax.cpp index 78832e1..4a889b9 100644 --- a/cpp/src/model/ais/v1_pure_minimax.cpp +++ b/cpp/src/model/ais/v1_pure_minimax.cpp @@ -7,7 +7,7 @@ #define MULTITHREADED 1 -static int position_counter; +static int position_counter = 0; Move ai::v1_pure_minimax::_search(const Board& b) { position_counter = 0; diff --git a/cpp/src/model/ais/v2_alpha_beta.cpp b/cpp/src/model/ais/v2_alpha_beta.cpp index 3a39474..8706487 100644 --- a/cpp/src/model/ais/v2_alpha_beta.cpp +++ b/cpp/src/model/ais/v2_alpha_beta.cpp @@ -8,7 +8,7 @@ #define MULTITHREADED 1 -static int position_counter; +static int position_counter = 0; Move ai::v2_alpha_beta::_search(const Board& b) { position_counter = 0; @@ -69,7 +69,6 @@ int ai::v2_alpha_beta::_search(const Board& b, int depth, int alpha, int beta) { std::vector moves = b.all_legal_moves(); - Move best_move; for (const Move& move : moves) { Board tmp_board = b.make_move(move); int tmp_eval = -_search(tmp_board, depth - 1, -beta, -alpha); diff --git a/cpp/src/view/noop.hpp b/cpp/src/view/noop.hpp index 34ae25b..90eb3a6 100644 --- a/cpp/src/view/noop.hpp +++ b/cpp/src/view/noop.hpp @@ -9,4 +9,8 @@ class NoOpView : public View { void update_board(const Board&, int8_t, std::vector) override {}; void notify_checkmate(Colour) override{}; void notify_stalemate(Colour) override{}; + + Piece ask_about_promotion() override { + return Queen; + }; };