Click here to Skip to main content
15,905,612 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Iain Clarke, Warrior Programmer11-Jul-10 22:53
Iain Clarke, Warrior Programmer11-Jul-10 22:53 
kcta5597 wrote:
but c is hard...


That's why you're taking a class, to learn more about it and make it easy!

I won't help directly (otherwise, how do you learn), but I will give a few tips:

1/Read the "how to ask a question" post at the top of this forum. It's there for YOUR own safety and convenience. Annoying people with badly formatted questions lowers your chances of being helped.

2/ Break your problem into manageable bits.

3/ Break your problem into manageable bits.

I know I said it twice, but it's the most important programming lesson you will ever learn.

The first bit of your assignment is to print a question. Look over your previous classwork and find out how to do that.
Next, get the answer from the user.
Then, validate the answer.
If the user puts in silly answers, tell them they're an idiot and loop back.
int nPlayingAs = 0;
...
while (nPlayingAs != PLAYER && nPlayingAs != BANKER)
{
   // ask the question
   ...
   // Get the answer into nPlayingAs
   ...
}


Notice I write PLAYER, not 1. Get in practise for later. It's over the top for this assignment, but your future self will thank you later.

Do the same with the bet number...

How you draw the cards is up to you.
You could have a random number from 0-51. Or, two random numbers: 0-3, and 0-12. This was you can say "4 of hearts", not just "4".

Make sure to keep track of cards you've already drawn. You don't want the user to think you're pulling the same card again, do you?

I wish you luck with your assignment,

Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!

GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Niklas L11-Jul-10 23:03
Niklas L11-Jul-10 23:03 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
CPallini11-Jul-10 23:06
mveCPallini11-Jul-10 23:06 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Niklas L11-Jul-10 23:09
Niklas L11-Jul-10 23:09 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Iain Clarke, Warrior Programmer11-Jul-10 23:15
Iain Clarke, Warrior Programmer11-Jul-10 23:15 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
CPallini11-Jul-10 23:04
mveCPallini11-Jul-10 23:04 
JokeRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Iain Clarke, Warrior Programmer11-Jul-10 23:16
Iain Clarke, Warrior Programmer11-Jul-10 23:16 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
CPallini11-Jul-10 23:20
mveCPallini11-Jul-10 23:20 
GeneralRe: i am makeing bacarrat in c language.... it's really hard could anyone plz help? Pin
Iain Clarke, Warrior Programmer11-Jul-10 23:25
Iain Clarke, Warrior Programmer11-Jul-10 23:25 
QuestionUpdateDriverForPlugAndPlayDevices failed,errcode=0x103 Pin
xjh_sz11-Jul-10 17:17
xjh_sz11-Jul-10 17:17 
AnswerRe: UpdateDriverForPlugAndPlayDevices failed,errcode=0x103 Pin
Peter_in_278011-Jul-10 17:46
professionalPeter_in_278011-Jul-10 17:46 
GeneralRe: UpdateDriverForPlugAndPlayDevices failed,errcode=0x103 Pin
xjh_sz11-Jul-10 18:01
xjh_sz11-Jul-10 18:01 
QuestionRead CPU temp Pin
VeganFanatic11-Jul-10 4:39
VeganFanatic11-Jul-10 4:39 
AnswerRe: Read CPU temp Pin
Code-o-mat11-Jul-10 10:48
Code-o-mat11-Jul-10 10:48 
GeneralRe: Read CPU temp Pin
VeganFanatic11-Jul-10 10:50
VeganFanatic11-Jul-10 10:50 
GeneralRe: Read CPU temp Pin
Code-o-mat11-Jul-10 10:58
Code-o-mat11-Jul-10 10:58 
GeneralRe: Read CPU temp Pin
VeganFanatic11-Jul-10 11:01
VeganFanatic11-Jul-10 11:01 
GeneralRe: Read CPU temp Pin
Code-o-mat11-Jul-10 11:10
Code-o-mat11-Jul-10 11:10 
AnswerRe: Read CPU temp Pin
Luc Pattyn11-Jul-10 10:50
sitebuilderLuc Pattyn11-Jul-10 10:50 
AnswerRe: Read CPU temp Pin
Rick York12-Jul-10 6:52
mveRick York12-Jul-10 6:52 
QuestionI want to search music on the internet,but i don`t know how to do it? Pin
caiguosen11-Jul-10 4:20
caiguosen11-Jul-10 4:20 
AnswerRe: I want to search music on the internet,but i don`t know how to do it? Pin
Niklas L11-Jul-10 23:05
Niklas L11-Jul-10 23:05 
QuestionGet full path of file from "Confirm file delete" window [modified] Pin
A_Fa10-Jul-10 21:04
A_Fa10-Jul-10 21:04 
QuestionSetting the text in an edit box of another application Pin
Still learning how to code10-Jul-10 10:12
Still learning how to code10-Jul-10 10:12 
AnswerRe: Setting the text in an edit box of another application Pin
Still learning how to code10-Jul-10 11:22
Still learning how to code10-Jul-10 11:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.