forked from ProgrammingCCC/blackjack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (28 loc) · 870 Bytes
/
main.cpp
File metadata and controls
32 lines (28 loc) · 870 Bytes
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
#include "logic.hpp"
int main()
{
srand(time(NULL));
int wins = 0, draws = 0, losses = 0;
int threshold = 17; // player hit cutoff sum
for (int i = 0; i < 100; ++i) {
auto game = Blackjack(threshold);
std::cout << "\n\nGAME " << i + 1 << "\n--------\n\n";
switch(game.play()) {
case OutcomeType::WIN:
std::cout << "WIN";
wins++;
break;
case OutcomeType::DRAW:
std::cout << "DRAW";
draws++;
break;
case OutcomeType::LOSE:
std::cout << "LOSE";
losses++;
break;
}
std::cout << std::endl;
}
std::cout << "\n\n------\n\n" << wins << " wins, " << draws << " draws, " << losses << " losses" << std::endl;
return 0;
}