diff options
Diffstat (limited to 'src/uci.cpp')
| -rw-r--r-- | src/uci.cpp | 19 |
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(); |
