summaryrefslogtreecommitdiff
path: root/sirtet.c
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-06-02 10:34:58 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-06-02 10:34:58 +0800
commit6e945b3f487d92d3cdf8706164da7040b9cb375a (patch)
treed9f03bb228f88678f22b52b0a3199118c834017c /sirtet.c
parenta21182592bc2b57eac8d2c53df1cfde30d438372 (diff)
Print game stats after exiting ncurses
Diffstat (limited to 'sirtet.c')
-rw-r--r--sirtet.c5
1 files changed, 5 insertions, 0 deletions
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[]) {