From 4b21ad49946bef562d388bd2d6185c3f98f9e87c Mon Sep 17 00:00:00 2001 From: dawidg81 Date: Sat, 24 Jan 2026 17:38:57 +0100 Subject: moved inGame declaration to header file --- src/.game.cpp.swp | Bin 0 -> 12288 bytes src/.main.cpp.swp | Bin 0 -> 12288 bytes src/game.cpp | 4 +--- src/game.hpp | 4 ++-- src/main.cpp | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 src/.game.cpp.swp create mode 100644 src/.main.cpp.swp diff --git a/src/.game.cpp.swp b/src/.game.cpp.swp new file mode 100644 index 0000000..f719d2a Binary files /dev/null and b/src/.game.cpp.swp differ diff --git a/src/.main.cpp.swp b/src/.main.cpp.swp new file mode 100644 index 0000000..d282d1f Binary files /dev/null and b/src/.main.cpp.swp differ diff --git a/src/game.cpp b/src/game.cpp index 0b15d96..3a7f7dc 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2,8 +2,6 @@ #include "game.hpp" using namespace std; -bool inGame = false; - void game(int diff){ int boardWidth; int boardHeight; @@ -59,4 +57,4 @@ void game(int diff){ break; } -} \ No newline at end of file +} diff --git a/src/game.hpp b/src/game.hpp index b5a16d5..83ff6fa 100644 --- a/src/game.hpp +++ b/src/game.hpp @@ -1,7 +1,7 @@ #ifndef GAME_HPP #define GAME_HPP -bool inGame; +bool inGame = false; void game(int diff); -#endif \ No newline at end of file +#endif diff --git a/src/main.cpp b/src/main.cpp index f25a00a..762be04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ using namespace std; int main(){ int choice; - while(inGame == false){ + while(!inGame){ cout << "Welcome to minesweeper 0.1.0\n"; cout << "\n"; cout << "Select difficulty:\n" -- cgit v1.2.3