aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-30 09:03:09 +0200
committerAdam <adammegarules1@gmail.com>2026-07-30 09:03:09 +0200
commit009c245757fc1ebbaa0212f89a4147d21d8b47e5 (patch)
treea3854d7a5bba3aa524603f6afdfd7b0922a48bd8 /src/uci.cpp
parent53e58af35c46140a05b3ce4dcec9e425ca359529 (diff)
adding board print
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index 3c72db0..70bf648 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -8,7 +8,9 @@
#include <cassert>
#include <cctype>
#include <cstdint>
+#include <cstdio>
#include <iostream>
+#include <print>
#include <sstream>
#include <string>
@@ -118,6 +120,20 @@ void Uci() {
cout << "done\n";
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();
+ }
+ }
+ cout.flush();
+ }
if (cmd == "load") {
LoadTable("cache/positions.txt", &transpositions);
cout << "done\n";