summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 920f28f4fef54a7c4b172838eb5c288fbc50d5c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <iostream>
using namespace std;

bool inGame = false;

void game(int diff){
	int boardWidth;
	int boardHeight;
	int board[boardWidth][boardHeight];
	int mines;

	switch(diff){
		case 0:
			boardWidth  = 9;
			boardHeight = 9;
			mines       = 9;
			break;

		case 1:
			boardWidth  = 16;
			boardHeight = 16;
			mines       = 12;
			break;

		case 2:
			boardWidth  = 30;
			boardHeight = 16;
			mines       = 16;
			break;

		case 3:
			cout << "Editing game parameters\n";
			
			cout << "Board Width: ";
			cin >> boardWidth;

			if(boardWidth > 32){
				cout << "Board width can't be more than 32 cells.\n";
			} else if(boardWidth < 8){
				cout << "Board width can't be less than 8 cells.\n";
			}

			cout << "Board Height: ";
			cin >> boardHeight;

			if(boardHeight > 32){
				cout << "Board height can't be more than 32 cells.\n";
			}else if(boardHeight < 8){
				cout << "Board height can't be less than 8 cells.\n";
			}

			cout << "Mines: ";
			cin >> mines;

			if(mines > 16){
				cout << "There can't be more than 16 mines.\n";
			}

			break;
	}
}

int main(){
	int choice;

	while(inGame == false){
		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);
		}
	}

	return 0;
}