summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordawidg81 <dawidgorski.m@gmail.com>2026-02-02 12:30:03 +0100
committerdawidg81 <dawidgorski.m@gmail.com>2026-02-02 12:30:03 +0100
commit90962f793887fd147dfc247e7f5b0d66ab9dac83 (patch)
tree48bf92d3e7a414c6bb7ae600cc6253c2ab7b19ee /src/main.cpp
parent3d8c56520f177d7eeaaea4dc3082a79eda3f487c (diff)
Added game input and board clear
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ef12c62..d4dab15 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,7 +4,7 @@ using namespace std;
int main(){
Game game;
- bool inGame = false;
+ game.inGame = false;
int choice;
cout << "Welcome to minesweeper 0.1.0\n";
@@ -19,21 +19,23 @@ int main(){
if(choice == 1){
game.initDiff(0);
- inGame = true;
+ game.inGame = true;
} else if(choice == 2){
game.initDiff(1);
- inGame = true;
+ game.inGame = true;
} else if(choice == 3){
game.initDiff(2);
- inGame = true;
+ game.inGame = true;
} else if(choice == 4){
game.editDiff();
- inGame = true;
+ game.inGame = true;
}
- while(inGame){
- game.initBoard();
+ game.initBoard();
+
+ while(game.inGame){
game.displayBoard();
+ game.input();
}
return 0;