From a31c98bc0aed77a3efbbd57a051f4af8e24824df Mon Sep 17 00:00:00 2001 From: dawidg81 Date: Sun, 1 Feb 2026 22:02:24 +0100 Subject: Starting handling game loop --- src/.Game.cpp.swp | Bin 12288 -> 0 bytes src/Game.cpp | 1 + src/main.cpp | 10 ++++++++++ 3 files changed, 11 insertions(+) delete mode 100644 src/.Game.cpp.swp diff --git a/src/.Game.cpp.swp b/src/.Game.cpp.swp deleted file mode 100644 index 1e31022..0000000 Binary files a/src/.Game.cpp.swp and /dev/null differ diff --git a/src/Game.cpp b/src/Game.cpp index 1ed4b50..7e54371 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -101,6 +101,7 @@ int Game::editDiff(){ 9 - revealed tile with 8 bomb around */ + void Game::displayBoard() { for (int i = 0; i < boardHeight; i++) { for (int j = 0; j < boardWidth; j++) { diff --git a/src/main.cpp b/src/main.cpp index 88b8ffa..ef12c62 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,7 @@ using namespace std; int main(){ Game game; + bool inGame = false; int choice; cout << "Welcome to minesweeper 0.1.0\n"; @@ -18,12 +19,21 @@ int main(){ if(choice == 1){ game.initDiff(0); + inGame = true; } else if(choice == 2){ game.initDiff(1); + inGame = true; } else if(choice == 3){ game.initDiff(2); + inGame = true; } else if(choice == 4){ game.editDiff(); + inGame = true; + } + + while(inGame){ + game.initBoard(); + game.displayBoard(); } return 0; -- cgit v1.2.3