Hello,
First, let me thank the boards and members for their indirect help over the few months while I've been learning C++.
Now, onto my question. I am supposed to be developing a Blackjack program. The two requirements are that it must have a class Card, which is made up of a suit and value. Then, I must have a class CardDeck, "Which is made up of an array of cards, and an int to indicate what the top card is (top of the stack)."It's constructor must initialize the deck, and it must also have a shuffleDeck and drawCard function.
This is what I have so far for class Card...
Code:enum Suit { clubs, diamonds, spades, hearts }; enum Rank { two = 2, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace }; class Card{ private: Suit color; Rank value; public: Card(){} };
Here is my pseudo code for CardDeck...
Code:Class CardDeck { private: //Declare perhaps an array of cards of the Card type? public: //Declare int for card drawn? CardDeck(){ //Constructor to initialize the array } //method to shuffle deck //method to draw card };
1. Am I on the right track?
2. If not, do you have any suggestions? I'm unsure of how exactly to start initializing the deck of cards (whether it's an array of the "Card" type, etc).
Thanks a bunch,
Mike



LinkBack URL
About LinkBacks




