summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 97117a47edc03e6d4b43c851b0074f3998ee0759 (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
#include "Game.hpp"

#include <ctime>
#include <iostream>

using namespace std;

int main(){

	Game game;
	game.inGame = false;
	int choice;

	cout << "Welcome to minesweeper v0.2.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.initDiff(0);
		game.inGame = true;
	} else if(choice == 2){
		game.initDiff(1);
		game.inGame = true;
	} else if(choice == 3){
		game.initDiff(2);
		game.inGame = true;
	} else if(choice == 4){
		game.editDiff();
		game.inGame = true;
	}

	srand(time(nullptr));
	game.initBoard();

	while(game.inGame){
		game.displayBoard();
		game.input();
		game.updateBoard();
		// cout << game.inGame;
	}

	return 0;
	
}