I am writing a Blackjack program and am having some trouble with it. I have already created 3 classes (i.e. Card.h, Deck.h, and Hand.h) but I am having trouble pulling them altogether in the Main. Here is what I need to do...
*Program will be playing single hands against getting to 21 until the deck is empty. Onece the deck is empty, even if it occurs in the middle of playing a hand, the program should end.
This is what I know so far, but how do I implement it into the main...
*When starting a new hand, 2 cards are dealt into that hand. I should take 2 cards off the deck using the getNextCard() method and add each card to the hand using the addCard() method.
*Next I should check to see if the player has a blackjack, outputing a message if they have and then move on to the next hand.
*Else, I should prompt the user to either hit or stand.
*If the user stands, then print they "Win" and the next hand should start.
*If the hit, get another card and add it to the hand.
*If they exceed 21 then print they "busted" and start next hand.
*If after hitting, their hand equals 21, then they win. Print a message and start new hand.
*If hand is still under 21, prompt user again if they want to stand or hit...repeat until they stand, get 21, or bust.
Main should look something like this...
Deck the Deck;
Hand the Hand;
//missing code here
Thanks for the help guys.