-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (46 loc) · 1.03 KB
/
main.cpp
File metadata and controls
55 lines (46 loc) · 1.03 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
#include <iostream>
#include "shoe.h"
#include "player.h"
#include "TypeOne.h"
#include "table.h"
#include "Dealer.h"
using namespace std;
int main() {
char option;
int nbPlayers;
for (;;) {
cout << "(a) Play" << endl << "(b) Test Statistiques" << endl << "(c) Quitter." << endl;
cin >> option;
switch (option) {
case 'a':
system("CLS");
cout << "How many players on the table ?";
cin >> nbPlayers;
break;
case 'b': {
do {
system("CLS");
cout << "How many players on the table ? (Maximum 6)" << endl;
cin >> nbPlayers;
} while (nbPlayers > 6 || nbPlayers < 1);
int type1 = nbPlayers / 2;
if (type1 == 0)
type1 = 1;
Table table(type1, nbPlayers - type1);
cout << "How many rounds do you want to simulate ?" << endl;
int nbRounds;
cin >> nbRounds;
table.play(nbRounds);
}
break;
case 'c':
system("CLS");
return 0;
break;
default:
cout << "Please select a valid choice." << endl;
break;
}
}
return 0;
}