Join 137,228 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,890 people online right now. Registration is fast and FREE... Join Now!
int main(void) { int turn = 0; int dealer =0; int player1 =0; int player2 =0; int cardvalue =0; int ranTotal =0; int hit=0; int bet=0; int cashTotal1=0; int cashTotal2=0; int choice=0; int ace=o; int totalparticipants=0; int howmanycards =0; int cardsuit=o; int Faceup =0; int Facedown =0; srand(time(0));
cout << "The card value was: "<< ranTotal << endl; player1 += ranTotal; } do { cout << "Player 1 has a total of: " << player1 << endl; cout << "Would you like a hit, if yes enter \"1\" else enter \"2\" : "; cin >> hit;
cardvalue=ranTotal; //declares value of card cout << cardvalue << endl;
i coule add a lot more commets or you could just read this..
this is a black jack game, at first there is bids, then the game goes at this point //Player 1 cout << "Player 1" << endl; cout << "___" << endl; for(int i= 0; i < 2; i++) { ranTotal = (rand()%10)+2;
then player2 makes his move then the one with the better score wins
thank you so much, now if you dont mind could you tell me how to add in the card pictures, i have pictures of what i want but i dont know how to do that
This post has been edited by Elende: 15 Feb, 2007 - 12:09 PM
So i have a problem with getting the cards into the program, i want images but all I have right now is the value of the Cards. How do you place a image in which you have saved into the code.
But the problem is i dont know how to add the cards in the program, i want it that they will be drawn from the deck and the two placed before you, then you could make a dissision on to hit or not. So how do you do that... here is the code, its becoming different from last time...
int main(void) { int turn = 0; int dealer =0; int player1 =0; int player2 =0; int cardvalue =0; int ranTotal =0; int hit=0; int bet=0; int cashTotal1=0; int cashTotal2=0; int choice=0; int ace=o; int totalparticipants=0; int howmanycards =0; int cardsuit=o; int Faceup =0; int Facedown =0; srand(time(0));
cout << "The card value was: "<< ranTotal << endl; player1 += ranTotal; } do { cout << "Player 1 has a total of: " << player1 << endl; cout << "Would you like a hit, if yes enter \"1\" else enter \"2\" : "; cin >> hit;
cardvalue=ranTotal; //declares value of card cout << cardvalue << endl;