Skip to content

Commit

Permalink
display statistics after win
Browse files Browse the repository at this point in the history
  • Loading branch information
Judro committed Nov 23, 2022
1 parent 0d760f4 commit a1abf72
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/mines.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
printw(" Game over \n");
GPrintable *gp = g_printable_gameover(game);
print(gp);
printw("Press <q> to get back to the menu\n");
printw("\n Press <q> to get back to the menu\n");
g_gprintable_kill(gp);
while (1) {
ret = cmove(game, window);
Expand All @@ -49,7 +49,17 @@ int main(int argc, char *argv[]) {
}
if (checkflags(game)) {
erase();
printw("You found all %d mines!", g_flags_total(game));
printw(" You found all %d mines in [%ld:%ld]:\n", g_flags_total(game),
(current - g_start(game)) / 60, (current - g_start(game)) % 60);
GPrintable *gp = g_printable_gameover(game);
print(gp);
printw("\n Press <q> to get back to the menu\n");
g_gprintable_kill(gp);
while (1) {
ret = cmove(game, window);
if (ret == -1)
break;
}
break;
}
// sleeps 0.01 seconds
Expand Down

0 comments on commit a1abf72

Please sign in to comment.