summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordawidg81 <dawidgorski.m@gmail.com>2026-02-01 12:33:31 +0100
committerdawidg81 <dawidgorski.m@gmail.com>2026-02-01 12:33:31 +0100
commit637b9d54be4601ff4120ca56aab2f28973d88f96 (patch)
tree1aebd24f6f8970eecd72643f8a1ba132673f3a61 /src
parent353846e64a2f810e6e527837a6e236ea31704ebb (diff)
Updated Game.cpp
Diffstat (limited to 'src')
-rw-r--r--src/Game.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Game.cpp b/src/Game.cpp
index ad29029..7f925fa 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -61,10 +61,28 @@ int Game::editDiff(){
std::cout << "Now editing custom difficulty" << std::endl;
std::cout << "Board width: ";
+ std::cin >> boardWidth;
+
+ if (boardWidth > MAX_W) {
+ std::cout << "Board width can't be more than " << MAX_W << " tiles." << std::endl;
+ return 1;
+ }
std::cout << "Board height: ";
+ std::cin >> boardHeight;
+
+ if (boardHeight > MAX_H) {
+ std::cout << "Board height can't be more than " << MAX_H << " tiles." << std::endl;
+ return 1;
+ }
std::cout << "Mines: ";
+ std::cin >> mines;
+
+ if (mines > 8 || mines > (boardWidth * boardHeight)) {
+ std::cout << "There can't be more than " << mines << "mines." << std::endl;
+ return 1;
+ }
return 0;
}