diff --git a/source/search.cpp b/source/search.cpp index 23d5c03..6ea69fd 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -135,13 +135,14 @@ static int NegaMax(Board board, int depth, int alpha, int beta, bool isRoot) { board.MakeMove(board.moveList[i]); ply++; int score = -NegaMax(board, depth - 1, -beta, -alpha, false); - board = copy; - ply--; + board = copy; ply--; if (score >= beta) { - // store killer moves - killerMoves[1][ply] = killerMoves[0][ply]; - killerMoves[0][ply] = board.moveList[i]; + if (board.moveList[i].IsCapture()) { + // store killer moves + killerMoves[1][ply] = killerMoves[0][ply]; + killerMoves[0][ply] = board.moveList[i]; + } return beta; } diff --git a/source/types.h b/source/types.h index 481ecd0..dcd8bef 100644 --- a/source/types.h +++ b/source/types.h @@ -6,7 +6,7 @@ using U64 = uint64_t; constexpr char StartingFen[] = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; constexpr char KiwiPeteFen[] = "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -"; -constexpr char KillerFen[] = "rnbqkb1r/pp1p1pPp/8/2p1pP2/1P1P4/3P3P/P1P1P3/RNBQKBNR w KQkq e6 0 1"; +constexpr char KillerFen[] = "6k1/3q1pp1/pp5p/1r5n/8/1P3PP1/PQ4BP/2R3K1 w - - 0 1"; enum COLOR { White, diff --git a/source/uci.cpp b/source/uci.cpp index a1b94f0..63d341a 100644 --- a/source/uci.cpp +++ b/source/uci.cpp @@ -26,8 +26,7 @@ Move ParseMove(Board &board, const char* moveString) { it = std::find(squareCoords.begin(), squareCoords.end(), toString); int to = std::distance(squareCoords.begin(), it); - - std::string promotionString = ""; +std::string promotionString = ""; // Finding the move from available moves for (Move move : board.moveList) { @@ -148,7 +147,7 @@ void ParseGo(Board &board, const char* command) { depth = atoi(command); } else { // other command parameters - depth = 5; + depth = 6; } // search position @@ -220,4 +219,4 @@ void UCILoop(Board &board) { continue; } } -} \ No newline at end of file +}