diff --git a/src/main.cpp b/src/main.cpp index dfb6f58..5e3154d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -255,12 +255,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); } }; } @@ -279,12 +282,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); } }; }