eval best move
authorLaurent Mazet <mazet@softndesign.org>
Mon, 1 Jul 2024 22:07:08 +0000 (00:07 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Mon, 1 Jul 2024 22:07:08 +0000 (00:07 +0200)
checkers.c

index c40efe013c79656c7604c55ec07b1028579b86f8..8f994688d64b47de2dde56e5e115964689de407d 100644 (file)
@@ -185,8 +185,11 @@ int main (int argc, char *argv[])
 
         boardwindow (board);
         if (1) { /* not end of game */
+            char msg[128] = {0};
             jump = cursorwindow (board, xcursor, ycursor, mode);
-            msgwindow (player == 0 ? "Player One": "Player Two", xmsg, ymsg, lmsg);
+            int nb = globalmaxjumps (board, player);
+            sprintf (msg, "Player %s (%d)", (player == 0) ? "One": "Two", nb);
+            msgwindow (msg, xmsg, ymsg, lmsg);
         } else {
             msgwindow ("End of game", xmsg, ymsg, lmsg);
         }