src/chess/pgn.c

changeset 101
d4f19182fdc2
parent 98
9cb41383540f
equal deleted inserted replaced
100:685af47592b5 101:d4f19182fdc2
203 if (i % 2 == 0) { 203 if (i % 2 == 0) {
204 fprintf(stream, "%d. %s", 1+i/2, gamestate->moves[i].string); 204 fprintf(stream, "%d. %s", 1+i/2, gamestate->moves[i].string);
205 } else { 205 } else {
206 fprintf(stream, "%s", gamestate->moves[i].string); 206 fprintf(stream, "%s", gamestate->moves[i].string);
207 } 207 }
208 208
209 // TODO: move time and maybe other comments 209 /* add clock times when the game was under time control */
210 if (gameinfo->timecontrol) {
211 char clkstr[16];
212 unsigned clkmv = i + 2; /* time for the next move! */
213 uint16_t clk = remaining_movetime2(gameinfo, gamestate, clkmv);
214 print_clk(clk, clkstr, true);
215 fprintf(stream, " {[%%clk %s]}", clkstr);
216 }
210 217
211 /* line break every 10 half-moves */ 218 /* line break every 10 half-moves */
212 if ((i+1) % 10) { 219 if ((i+1) % 10) {
213 fputc(' ', stream); 220 fputc(' ', stream);
214 } else { 221 } else {

mercurial