-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (31 loc) · 2.04 KB
/
Copy pathmain.cpp
File metadata and controls
47 lines (31 loc) · 2.04 KB
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
#include <conio.h>
#include <Windows.h>
#include "countries.h"
#include "utility.h"
#include "sights.h"
#include "Structures.h"
using namespace std;
/*
Образовательный проект, направленный на изучение отдельных областей географии в игровой форме
*/
void main()
{
system("color F0"); // задает белый цвет консоли и черный цвет текста
enum Choice { Neutral = -1, Exit, Capital, Sight }; //
Choice key = Neutral; // объявляем переменную key присваиваем ей нейтральное значение
int choice = key; // переменная для выбора пользователя
/*пока пользователь не выберет "Exit" работа программы продолжатся*/
while (choice != Exit)
{
cout << "Hey, in which game do you want to play? (Enter a number)\n1. Countries and Capital Cities\n2. Sights Of The World\n0. Exit" << endl;
cin >> choice; // пользователь вводит своё решение
/*выбор игры или выход из программы*/
switch (choice)
{
case(Capital): desire_playing(countries); break; // если пользователь вводит 1, то запускается игра "Countries And Capital Cities"
case(Sight): desire_playing(sights); break; // если пользователь вводит 2, то запускается игра "Sights Of The World"
case(Exit): break; // если пользователь вводит 0, то работа программы заканчивается
default:{incorrect_input();} // если пользователь не вводит ни одно из вышеперечисленных значений, то на жкран выводится сообщение об ошибке
}
}
}