-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
59 lines (45 loc) · 1.18 KB
/
main.cpp
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
#include <iostream>
#include "Inputs.h"
#include "Game.h"
int main(int argc, char const *argv[])
{
std::string choice;
int col, row;
std::cout << "\t -:: Labyrinth game ::-" << std::endl;
while (choice != "3"){ // Simple user interface
std::cout
<< "Choose option" << std::endl
<< "[1] -\t Play" << std::endl
<< "[2] -\t About" << std::endl
<< "[3] -\t Exit program" << std::endl;
getline(std::cin, choice);
std::cout << std::endl;
if (choice == "1"){ // play
std::cout
<< "What dificulty would you play" << std::endl
<< "[1] -\t Easy" << std::endl
<< "[2] -\t Normal" << std::endl
<< "[3] -\t Hard" << std::endl;
std::getline(std::cin, choice);
if(choice == "1")
col = row = 10;
else if(choice == "2")
col = row = 30;
else if(choice == "3")
col = row = 100;
if (Check_valid_size(col) && Check_valid_size(row)){
// Generate a maze
Game::start(col, row);
}
continue;
}
else if(choice == "2"){ // Print about message
std::cout << "Awesome game!" << std::endl;
}
else if(choice == "3") // exit
return 0;
else
std::cout << "Please choose between [1], [2] and [3]." << std::endl;
}
return 0;
}