summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/main.cpp b/main.cpp
index 182dbdb..6b1bfb5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -38,16 +38,15 @@ int main(int argc, char *argv[])
cout << "\n> Dealing cards to the user" << endl;
pokerGame->dealUserCards();
pokerGame->sortUserCards();
- cout << "Cards in your hand: ";
- pokerGame->printUserCards();
- pokerGame->userAI(pokerGame->getUserCards());
- cout << "\nFinal cards in your hand: ";
- pokerGame->sortUserCards();
- pokerGame->printUserCards();
- cout << "> Dealing cards to opponent(s)" << endl;
+ cout << "> Dealing cards to opponent(s)" << endl << endl;
pokerGame->dealOpponentCards();
pokerGame->sortOpponentCards();
+
+ cout << "Cards in your hand: ";
+ pokerGame->printUserCards();
+
+ pokerGame->userAI(pokerGame->getUserCards());
#ifdef DEBUG
PRINT_COLOR(ANSI_COLOR_CYAN, "\ndebug: opponents' cards:\n");
pokerGame->printOpponentCards();
@@ -58,10 +57,16 @@ int main(int argc, char *argv[])
int i;
for (i = 0; i < pokerGame->numOfOpponents; i++)
pokerGame->opponentAI(i+1);
-
/* resort the cards after the AI */
pokerGame->sortOpponentCards();
+ cout << "\nFinal cards in your hand: ";
+ pokerGame->sortUserCards();
+ pokerGame->printUserCards();
+
+ cout << "Final opponents' cards:" << endl;
+ pokerGame->printOpponentCards();
+
#ifdef DEBUG
PRINT_COLOR(ANSI_COLOR_CYAN, "\ndebug: resorted opponents' cards:\n");
pokerGame->printOpponentCards();
@@ -69,12 +74,9 @@ int main(int argc, char *argv[])
pokerGame->printPile();
#endif
- pokerGame->evaluateHand(pokerGame->getUserCards(), i);
-
- /* evaluate */
- for (i = 0; i < pokerGame->numOfOpponents; i++)
- pokerGame->evaluateHand( pokerGame->getOpponentsCards(i+1), i+1 );
-
+ pokerGame->evaluateHand(pokerGame->getUserCards(), 0); /* user hand */
+ for (i = 0; i < pokerGame->numOfOpponents; i++) /* opponents hands */
+ pokerGame->evaluateHand(pokerGame->getOpponentsCards(i+1), i+1);
pokerGame->showHands();
/* ask to repeat the game and reset the deck of cards */