Programming Tools
Problem for Programming Tools
Generic problem for all Programming Tools

C++ poker program




By tereh_devil on Sep 23, 2009

" "
I'm an IT stucent assigned to make a poker program in c++. The program should ask the user to input a five card combination and determine what poker hand is it (full house, flush etc.).
is there any c++ commands that screens input data?
how do i use the linear search? is it applicable fto the program?

Solution #1

posted on Nov 24, 2009
Not Rated)

Clasty

Rank: Wiz 
Rating: 90%, 7 votes
Hi.

I suggest creating an Array of Cards (cardOne,cardTwo,etc. to five)

If you can enter them in one at a time, after declaring the array, assign the values to the array.

cin < cardOne; (Psuedo code by the way, hope you don't mind)

Afterwards, you'll have an array with 5 cards.

Declare what full houses, flushes, etc would require.
Use an if statement (If you don't mind lots of code) to compare the entered Array against possible hands.

I didn't necessarily give you any specific C++ code. However, if you Google C++ user input, you should find plenty of commands that may help you.

Good Luck

(And not sure about Linear search to be honest, you can use a Linear search, but if you did it the way I explained, you just have to compare hand to a series of conditionals.)



Was this helpful?
Yes
No

Solution #2

posted on Oct 06, 2009
Not Rated)

T3KK

Rank: Guru  Computer Software  Expert
Rating: 91%, 62 votes
If it is a command line programme then give them key words to use like ACE, TWO, JACK etc and of course HEARTS, CLUBS, DIAMONDS, SPADES

For the Ace, Two, Three etc assign the corresponding numeric value = Ace will have the values 1 and 11

Then parse the results to determine the hand the user has in put - remembering some hands are like 10 high and rubbish like that!

Have fun!
Was this helpful?
Yes
No

Popular Solutions for Programming Tools


Questions and Unsolved Problems for Programming Tools


Answer
where can I get a customer tool disk for a sharp xa-a41s??

Answer
photoshop 7.0 installation fails with the error message: "An error occurred during the move... (More)

Answer
how can I check if shockwave is enable or not in the page. Is there a javascript for it ?

Answer
How do you thread a Gimbel's sewing machine? Can it be that I don't have it threaded right. This... (More)

Answer
preemptive and non preemptive cpu algorithems,,,sjf / fcs /pp/RR


Didn't find what you were looking for?

Describe your problem:

Select a Category:







Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Browse popular Problems
More Common Problems
Most Common Problems for:
For Programming Tools:

Top Programming Tool Experts

Rank: Guru Guru  

Solutions: 1460
Member Since: July 2009

Experience: I have owned a computer networking sales and service company.

Ask Me
Find more Programming Tool Experts

Top Computer & Laptop Repair

(877) 729-0812
We connect to your computer over the Internet to...
Remote Repair

(952) 890-7770
Zkarlo.com provides discount and used laptop parts...
Zkarlo.com


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

X
Continue
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!
Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select