aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index 70bf648..e425cde 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -3,6 +3,7 @@
#include "board/fen.hpp"
#include "bot.hpp"
#include "moves.hpp"
+#include "zobrist/zobrist.hpp"
#include <algorithm>
#include <cassert>
@@ -10,7 +11,6 @@
#include <cstdint>
#include <cstdio>
#include <iostream>
-#include <print>
#include <sstream>
#include <string>
@@ -98,6 +98,8 @@ Game initBoard(
setBoardFen(startingFEN, &b);
+ uint64_t key = GenerateZobristKey(&b);
+ b.ThreeFoldMap[key] = 1;
return b;
};
void Uci() {
@@ -121,18 +123,17 @@ void Uci() {
cout.flush();
}
if (cmd == "board") {
- for (int i = 0; i < 64; i++) {
- Piece piece = game.pieces[i];
- if (piece.type == NONEPIECE) {
- cout << " --- ";
- continue;
- }
- printf(" %d%d", piece.type, piece.color);
- if (i % 8 == 0) {
- println();
+ for (int rank = 0; rank < 8; rank++) {
+ std::printf("%d |", 8 - rank);
+
+ for (int file = 0; file < 8; file++) {
+ Piece piece = game.pieces[rank * 8 + file];
+
+ std::printf(" %d%d", piece.type, piece.color);
}
+
+ std::printf(" | %d\n", 8 - rank);
}
- cout.flush();
}
if (cmd == "load") {
LoadTable("cache/positions.txt", &transpositions);