summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 9f70dcd7f7ec2bf254afb68c58762d4dcc79e32f (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
#include <iostream>
#include "Game.hpp"
using namespace std;

int main(){
	Game game;
	game.inGame = false;
	int 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.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();
	}

	return 0;
}