-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (39 loc) · 1.16 KB
/
main.cpp
File metadata and controls
52 lines (39 loc) · 1.16 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
#include <iostream>
#include "Card.h"
#include "Deck.h"
#include "CardHand.h"
#include "PokerScore.h"
#include "CardHandScorer.h"
#include "Application.h"
int main() {
srand(time(0));
Deck deck;
std::cout << deck;
std::cout << std::endl;
Card dealtCard;
CardHand theCards;
PokerScore pokerScore;
bool noRoyalFlush = true;
while(noRoyalFlush) {
// keep iterating until a royal flush is obtained
for (int j = 0; j < 5; j++) {
dealtCard = deck.dealCard();
theCards.addCard(dealtCard);
}
theCards.sortRank();
// std::cout << theCards << std::endl;
pokerScore += CardHandScorer::scorePokerHand(theCards, noRoyalFlush);
deck.resetDeck();
//Clear hand for a new check
theCards.resetHand();
}
std::cout << pokerScore << std::endl;
////Test
// CardHand test({{CLUBS, KING}, {DIAMONDS, NINE}, {CLUBS, JACK}, {HEARTS, QUEEN}, {HEARTS, TEN}});
// test.sortRank();
// pokerScore = CardHandScorer::scorePokerHand(test);
// std::cout << test << std::endl;
// std::cout << pokerScore << std::endl;
Application::run();
return 0;
}