Bsbosa.com
07-13-2010, 04:07 AM
this is the sourse code............ and i don know what to do next....
could anyone plz check if this sourse code is right and plz help
me to finish full baccarat program?
i am always tryin and tryin but c is hard...
#include #include int drawCard();
int get2cards(int who);
void get3rdCard(int who, int *p_total);
main() {
int playerTotal; BankerTotal;
srand(time(NULL));
playerTotal = get2cards(1);
BankerTotal = get2cards(2);
if (playerTotal < 6)
get3rdCard(1, &playerTotal);
}
int drawCard() {
int value;
value = rand() %13 + 1;
return value;
}
int get2cards(int who) {
int total;
total = drawCard();
total += drawCard();
return total;
}
void get3rdCard(int who, int *p_total) {
int card3;
card3 = drawCard();
}
o.... and the output.... has to be like this...
plz help me.. thank you very much
PLAY BACCARAT Enter bet winner (1-Player/ 2-Banker): 0
Invalid - must choose winner as 1-player or 2-Banker: 3
Invalid - must choose winner as 1-player or 2-Banker: 2
Enter bet amount (2-20): 21
Invalid - bet must be between 2 and 20: 1
Invalid - bet must be between 2 and 20: 10 Player Cards: 7 8
Player total: 5 Banker Cards: 4 Queen
Banker total: 4 Player draws again: a(n) 10 to get total of 5
Player wins
Your bet lost!
could anyone plz check if this sourse code is right and plz help
me to finish full baccarat program?
i am always tryin and tryin but c is hard...
#include #include int drawCard();
int get2cards(int who);
void get3rdCard(int who, int *p_total);
main() {
int playerTotal; BankerTotal;
srand(time(NULL));
playerTotal = get2cards(1);
BankerTotal = get2cards(2);
if (playerTotal < 6)
get3rdCard(1, &playerTotal);
}
int drawCard() {
int value;
value = rand() %13 + 1;
return value;
}
int get2cards(int who) {
int total;
total = drawCard();
total += drawCard();
return total;
}
void get3rdCard(int who, int *p_total) {
int card3;
card3 = drawCard();
}
o.... and the output.... has to be like this...
plz help me.. thank you very much
PLAY BACCARAT Enter bet winner (1-Player/ 2-Banker): 0
Invalid - must choose winner as 1-player or 2-Banker: 3
Invalid - must choose winner as 1-player or 2-Banker: 2
Enter bet amount (2-20): 21
Invalid - bet must be between 2 and 20: 1
Invalid - bet must be between 2 and 20: 10 Player Cards: 7 8
Player total: 5 Banker Cards: 4 Queen
Banker total: 4 Player draws again: a(n) 10 to get total of 5
Player wins
Your bet lost!