summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-08-31 08:14:30 +0300
committereug-vs <eugene@eug-vs.xyz>2022-08-31 08:39:21 +0300
commitd3c719b48c8fa73a5b281b54df265cfe597c5b86 (patch)
treeeaca6880dc224593572e5ed4eafbe4f5de15ea7d
parent1ee34b9d35a1ad6083967f858988180a425e43ec (diff)
downloadc-chess-d3c719b48c8fa73a5b281b54df265cfe597c5b86.tar.gz
feat: display floating point evaluation
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index c68c62e..e25d6e2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -598,7 +598,7 @@ int main() {
while (1) {
int color = ply % 2;
printf("##### Ply %i #####\n", ply);
- printf("Current evaluation: %i\n", evaluate_position(board, 0, WHITE));
+ printf("Current evaluation: %.2f\n", (double)evaluate_position(board, 0, WHITE) / 10);
if (color == PLAYER) {
printf("Enter a move for %s:\n", COLORS[color]);
@@ -615,7 +615,7 @@ int main() {
char move_in_notation[] = "xy XY";
index_to_notation(move.origin, move_in_notation);
index_to_notation(move.destination, move_in_notation + 3);
- printf("%s: %s with evaluation %c=%i on Ply %i\n", COLORS[color], move_in_notation, color == WHITE ? '>' : '<', move.value, ply + MAX_DEPTH);
+ printf("%s: %s with evaluation %c=%.2f on Ply %i\n", COLORS[color], move_in_notation, color == WHITE ? '>' : '<', (double)move.value / 10, ply + MAX_DEPTH);
}
int error = validate_move(move, color, board);