diff options
| -rw-r--r-- | main.cpp | 8 | ||||
| -rw-r--r-- | opponent.cpp | 12 | ||||
| -rw-r--r-- | opponent.h | 6 | 
3 files changed, 13 insertions, 13 deletions
| @@ -57,15 +57,15 @@ int main(int argc, char *argv[])          pokerGame->printUserCards();          cout << "\nDealing cards to opponent(s)" << endl; -        pokerGame->dealOpponentCards(pokerGame->numOfOpponents); -        pokerGame->sortOpponentCards(pokerGame->numOfOpponents); +        pokerGame->dealOpponentCards(); +        pokerGame->sortOpponentCards();          cout << "Opponents' cards:" << endl; -        pokerGame->printOpponentCards(pokerGame->numOfOpponents); +        pokerGame->printOpponentCards();  #ifdef DEBUG          cout << "Computer's AI" << endl;          pokerGame->opponentAI(pokerGame->getOpponentsCards(1)); -        pokerGame->printOpponentCards(pokerGame->numOfOpponents); +        pokerGame->printOpponentCards();  #endif  #ifdef DEBUG diff --git a/opponent.cpp b/opponent.cpp index 7f8a14b..022e26c 100644 --- a/opponent.cpp +++ b/opponent.cpp @@ -11,19 +11,19 @@ Opponent::Opponent(void) : whatHand(9)  } -void Opponent::dealOpponentCards(int opponentsAmount) +void Opponent::dealOpponentCards(void)  {      /* the cards will be dealt from end of the deck array using deckCurrIndex */      int i, j; -    for (j = 0; j < opponentsAmount; j++) +    for (j = 0; j < numOfOpponents; j++)          for (i = 0; i < 5; i++)              opponentCards[j][i] = PopCardFromDeck();  } -void Opponent::printOpponentCards(int opponentsAmount) +void Opponent::printOpponentCards(void)  {      int j; -    for (j = 0; j < opponentsAmount; j++) +    for (j = 0; j < numOfOpponents; j++)      {          cout << "Opponent " << j+1 << ": "; @@ -35,10 +35,10 @@ void Opponent::printOpponentCards(int opponentsAmount)      }  } -void Opponent::sortOpponentCards(int opponentsAmount) +void Opponent::sortOpponentCards(void)  {      int j; -    for (j = 0; j < opponentsAmount; j++) +    for (j = 0; j < numOfOpponents; j++)          sortCards(opponentCards[j]);  } @@ -13,9 +13,9 @@ class Opponent : virtual public CardPile      public:          Opponent(void); -        void dealOpponentCards(int); -        void printOpponentCards(int); -        void sortOpponentCards(int); +        void dealOpponentCards(); +        void printOpponentCards(); +        void sortOpponentCards();          Card **getOpponentsCards(int);          int numOfOpponents; | 
