aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-16 11:22:34 +0200
committerAdam <adammegarules1@gmail.com>2026-08-16 11:22:34 +0200
commit8e47b8f9f8a017f25a1c9a9baba05b0bf9b12d2d (patch)
tree6ee118919928e33d4115d78a6565940f26c8b30c /src/uci.cpp
parentb0ed5c409f822fa120ef2e2c830842204b0945c1 (diff)
perf(draw) instead of having a hash map for three fold repetion check now we have
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index ff8bc33..b78ffea 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -66,20 +66,20 @@ uint16_t UciToMove(const std::string &uci) {
Game initBoard(
const std::string &startingFEN,
std::unordered_map<uint64_t, TranspositionsEntry> *transPositions) {
- Game b{};
- b.enPassant = IndexToPosition(0); // default value
- b.canEnpassant = false;
- b.state = TURN;
- b.turn = true;
- b.halfMoveClock = 0;
- b.MoveClock = 0;
- b.Transpositions = transPositions;
-
- setBoardFen(startingFEN, &b);
-
- uint64_t key = GenerateZobristKey(&b);
- b.ThreeFoldMap[key] = 1;
- return b;
+ Game g{};
+ g.enPassant = IndexToPosition(0); // default value
+ g.canEnpassant = false;
+ g.state = TURN;
+ g.turn = true;
+ g.halfMoveClock = 0;
+ g.MoveClock = 0;
+ g.Transpositions = transPositions;
+
+ setBoardFen(startingFEN, &g);
+
+ uint64_t key = GenerateZobristKey(&g);
+ g.history.push_back(key);
+ return g;
};
static void PrintBitboard(uint64_t bb, const std::string &name) {
std::cout << name << "\n";