aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index 31c4e43..ffab5bc 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -42,10 +42,10 @@ Move UciToMove(const string uci) {
Position to;
from.file = static_cast<uint8_t>(uci[0] - 'a');
- from.rank = static_cast<uint8_t>('8' - uci[1]);
+ from.rank = static_cast<uint8_t>(uci[1] - '1');
to.file = static_cast<uint8_t>(uci[2] - 'a');
- to.rank = static_cast<uint8_t>('8' - uci[3]);
+ to.rank = static_cast<uint8_t>(uci[3] - '1');
return {from, to};
}
@@ -181,8 +181,8 @@ void Uci() {
Move best = GetBestMove(&game, depth);
cout << "bestmove ";
- cout << static_cast<char>(best.From.file + 'a') << 8 - best.From.rank
- << static_cast<char>(best.To.file + 'a') << 8 - best.To.rank;
+ cout << static_cast<char>(best.From.file + 'a') << 1 + best.From.rank
+ << static_cast<char>(best.To.file + 'a') << 1 + best.To.rank;
if (best.promotion != NONEPIECE) {
switch (best.promotion) {