From 6e945b3f487d92d3cdf8706164da7040b9cb375a Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 2 Jun 2022 10:34:58 +0800 Subject: Print game stats after exiting ncurses --- sirtet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sirtet.c b/sirtet.c index 9a2ef69..0a8cc8f 100644 --- a/sirtet.c +++ b/sirtet.c @@ -224,6 +224,7 @@ void sirtet(int H, int W, int P) { } if (!has_placeable) { // game over + printmap(map, 1, 1, H, W); mvprintw(7, 2 * W + 8, "Game over"); mvprintw(8, 2 * W + 8, "Press any key to exit"); refresh(); @@ -245,6 +246,10 @@ void sirtet(int H, int W, int P) { // end ncurses endwin(); + + // print game stats + printf("SIRTET\n"); + printf("You scored %d points\n", points); } int main(int argc, char *argv[]) { -- cgit v1.2.3