Thu, 16 Apr 2026 19:59:08 +0200
add clock times to PGN output
resolves #815
| src/chess/pgn.c | file | annotate | diff | comparison | revisions |
--- a/src/chess/pgn.c Thu Apr 16 19:49:16 2026 +0200 +++ b/src/chess/pgn.c Thu Apr 16 19:59:08 2026 +0200 @@ -205,8 +205,15 @@ } else { fprintf(stream, "%s", gamestate->moves[i].string); } - - // TODO: move time and maybe other comments + + /* add clock times when the game was under time control */ + if (gameinfo->timecontrol) { + char clkstr[16]; + unsigned clkmv = i + 2; /* time for the next move! */ + uint16_t clk = remaining_movetime2(gameinfo, gamestate, clkmv); + print_clk(clk, clkstr, true); + fprintf(stream, " {[%%clk %s]}", clkstr); + } /* line break every 10 half-moves */ if ((i+1) % 10) {