1
0
mirror of https://github.com/tiyn/yeschess.git synced 2025-10-18 22:01:21 +02:00

bugfix chess: moveToNotation promotion part wrong

The function moveToNotation added the promotion character
even if a piece and not a pawn moves to the final rank.
This commit is contained in:
TiynGER
2021-05-04 00:46:17 +02:00
parent 4cac1ba6bf
commit 087da7d3f1
3 changed files with 75 additions and 80 deletions

View File

@@ -184,7 +184,7 @@ proc bestMove*(chess: Chess, depth: int): Move =
var tmpChess = chess
tmpChess.checkedMove(move)
var tmpEval = -tmpChess.negaMax(depth, LoVal, HiVal)
echo("move:", moveToNotation(move), "; eval:", tmpEval)
echo("move:", moveToNotation(move, tmpChess.board), "; eval:", tmpEval)
if tmpEval > bestEval:
bestEval = tmpEval
bestMove = move