-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (60 loc) · 1.28 KB
/
main.cpp
File metadata and controls
64 lines (60 loc) · 1.28 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <string>
#include <cstdlib>
#include <fstream>
#include "judge.h"
using namespace std;
void menu();
int main(){
int option, type;
string name;
Judge controller;
while(true){
menu();
cin >> option;
system("cls");
switch(option){
case 1:
// nowa gra
cout << "1. Gracz vs Gracz\n";
cout << "2. Gracz vs Komputer\n";
cin >> type;
system("cls");
controller.newGame(type);
break;
case 2:
// wczytaj grę
controller.loadGame("last.sav");
break;
case 3:
// statystyki
controller.stats();
break;
case 4: {
ifstream manual("manual.txt");
string line;
while(getline(manual, line)) cout << line << '\n';
cout << "\n\nNacisnij ENTER, aby kontynuwac...";
cin.get();
cin.get();
system("cls");
}
break;
case 5:
return 0;
break;
default:
cout << "Nie ma takiej opcji!\n";
continue;
}
}
return 0;
}
void menu(){
cout << " ======== STATKI =======\n";
cout << "1. Nowa gra\n";
cout << "2. Wczytaj gre\n";
cout << "3. Statystyki\n";
cout << "4. Instrukcja\n";
cout << "5. Zakoncz\n";
}