diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-30 09:03:09 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-30 09:03:09 +0200 |
| commit | 009c245757fc1ebbaa0212f89a4147d21d8b47e5 (patch) | |
| tree | a3854d7a5bba3aa524603f6afdfd7b0922a48bd8 /src | |
| parent | 53e58af35c46140a05b3ce4dcec9e425ca359529 (diff) | |
adding board print
Diffstat (limited to 'src')
| -rw-r--r-- | src/uci.cpp | 16 |
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"; |
