From 082f4df08cd0e8ff4680226920df3d864536c333 Mon Sep 17 00:00:00 2001 From: thorium1256 Date: Fri, 27 Jun 2025 15:40:48 +0300 Subject: [PATCH] gameover/win conditions --- src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7e34a3f..9c7649c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -251,12 +251,15 @@ void startGame(Board &board) mvprintw(1, 8, "%s", tim); attroff(COLOR_PAIR(3)); refresh(); - while ((c = getch()) != 'q') + while (true) { + c = getch(); if (c == 'r') { Board newBoard(boardSize.x, boardSize.y, board.getMineCount()); startGame(newBoard); + } else if(c == 'q') { + exit(0); } }; } @@ -275,12 +278,15 @@ void startGame(Board &board) attroff(COLOR_PAIR(3)); refresh(); int c; - while ((c = getch()) != 'q') + while (true) { + c = getch(); if (c == 'r') { Board newBoard(boardSize.x, boardSize.y, board.getMineCount()); startGame(newBoard); + } else if(c == 'q') { + exit(0); } }; }