summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordawidg81 <dawidgorski.m@gmail.com>2026-01-25 17:01:43 +0100
committerdawidg81 <dawidgorski.m@gmail.com>2026-01-25 17:01:43 +0100
commitf5d734e3420e216816a4ac5ef50d022bb4b4ab85 (patch)
tree971a44caa54600289cd1b0713ce877041d406259 /src
parent19f02b9d85c8ada9cca07a87199f68e2a31b303c (diff)
reverted difficulty editing feature
Diffstat (limited to 'src')
-rw-r--r--src/game/game.cpp6
-rw-r--r--src/game/globals.hpp1
-rw-r--r--src/main.cpp37
3 files changed, 25 insertions, 19 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 4f4d1f9..463a84e 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -4,6 +4,12 @@
#include <cstdio>
#include <iostream>
+using namespace std;
+
+void Game::editDiff(){
+ cout << "Now editing custom difficulty" << endl;
+}
+
void Game::initDiff(int diff) {
switch (diff) {
case 0:
diff --git a/src/game/globals.hpp b/src/game/globals.hpp
index 054dc6e..7518a84 100644
--- a/src/game/globals.hpp
+++ b/src/game/globals.hpp
@@ -15,6 +15,7 @@ private:
int mines;
public:
+ void editDiff();
void initDiff(int diff);
void initBoard();
void displayBoard();
diff --git a/src/main.cpp b/src/main.cpp
index 5498cf9..3f18423 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,28 +3,27 @@
using namespace std;
int main(){
+ Game game;
int choice;
- while(!inGame){
- cout << "Welcome to minesweeper 0.1.0\n";
- cout << "\n";
- cout << "Select difficulty:\n"
- "1. Easy\n"
- "2. Medium\n"
- "3. Hard\n"
- "4. Custom\n";
- cout << "Difficulty: ";
- cin >> choice;
+ cout << "Welcome to minesweeper 0.1.0\n";
+ cout << "\n";
+ cout << "Select difficulty:\n"
+ "1. Easy\n"
+ "2. Medium\n"
+ "3. Hard\n"
+ "4. Custom\n";
+ cout << "Difficulty: ";
+ cin >> choice;
- if(choice == 1){
- game(0);
- } else if(choice == 2){
- game(1);
- } else if(choice == 3){
- game(2);
- } else if(choice == 4){
- game(3);
- }
+ if(choice == 1){
+ game.initDiff(0);
+ } else if(choice == 2){
+ game.initDiff(1);
+ } else if(choice == 3){
+ game.initDiff(2);
+ } else if(choice == 4){
+ game.initDiff(3);
}
return 0;