Position history encaps #52
+3
-2
@@ -12,7 +12,7 @@
|
|||||||
#include "perft.h"
|
#include "perft.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
static void ParsePosition(Board &board, std::string_view command) {
|
static void ParsePosition(Board &board, std::string_view command, SEARCH::SearchContext& ctx) {
|
||||||
if (command.find("startpos") != std::string::npos) {
|
if (command.find("startpos") != std::string::npos) {
|
||||||
board.SetByFen(StartingFen);
|
board.SetByFen(StartingFen);
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@ static void ParsePosition(Board &board, std::string_view command) {
|
|||||||
|
|
||||||
for (std::string_view move : moves) {
|
for (std::string_view move : moves) {
|
||||||
bool isLegal = board.MakeMove(UTILS::parseMove(board, move));
|
bool isLegal = board.MakeMove(UTILS::parseMove(board, move));
|
||||||
|
ctx.positionHistory[board.positionIndex] = board.hashKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +125,7 @@ void UCILoop(Board &board) {
|
|||||||
|
|
||||||
// parse UCI "position" command
|
// parse UCI "position" command
|
||||||
if (input.find("position") != std::string::npos) {
|
if (input.find("position") != std::string::npos) {
|
||||||
ParsePosition(board, input);
|
ParsePosition(board, input, ctx);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user