I'll take the first line. And, okay, the first "shuffleDeck()" line. But the rest ... no. You don't shuffle the cards after every time you deal a card! And why are you giving the dealer the name...
Type: Posts; User: tabstop
I'll take the first line. And, okay, the first "shuffleDeck()" line. But the rest ... no. You don't shuffle the cards after every time you deal a card! And why are you giving the dealer the name...
I don't know how well acting helpless works for you IRL; it's getting old here. How have you gotten your program to where it is if you don't know how to declare variables?
So a hand is a bunch of cards. Therefore you need P_hand and D_hand to be things that can hold a bunch of cards, like say an array of cards. (Just like the deck is an array of cards.)
Are P_hand supposed to represent the actual hand or just the value? Since right now, they're ints, and obviously you can't store a bunch of cards to an int.
You definitely need to shuffle more than 10 cards in your deck. You should shuffle the whole deck; something like
for (i = 0; i < 52; i++) {
int j = i + rand()%(52-i); //pick a card to...
So first, shuffle the deck.
Then, deal from the deck, so you will get card 0, the dealer will get card 1, you will get card 2, the dealer will get card 3. So if you are printing the dealer hand,...