aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-28 12:50:36 +0200
committerAdam <adammegarules1@gmail.com>2026-07-28 12:50:36 +0200
commit50be320c33bd942b238e8f82aa34230539878bab (patch)
treed4b98a6a90e49cd29cfdbb8fbf0512e64d907217 /src/uci.cpp
parent3109a2516e75072835f1998a9b702003781612d5 (diff)
changes
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index a2c3672..42be55d 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -5,6 +5,7 @@
#include "moves.hpp"
#include <algorithm>
+#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdlib>
@@ -99,6 +100,24 @@ void Uci() {
cout << "bestmove ";
cout << (char)(best.From.file + 'a') << 8 - best.From.rank
<< (char)(best.To.file + 'a') << 8 - best.To.rank;
+ if (best.promotion != NONE) {
+ switch (best.promotion) {
+ case QUEEN:
+ cout << "q";
+ break;
+ case ROOK:
+ cout << "r";
+ break;
+ case KNIGHT:
+ cout << "n";
+ break;
+ case BISHOP:
+ cout << "b";
+ break;
+ default:
+ assert(false && "Unexepted promotion type");
+ }
+ }
println();
cout.flush();