Jump to content
xisto Community
Sign in to follow this  
Jeune

Programming Assignment on a poker card game

Recommended Posts

I have a programming assignment involving a poker card game. But since I don't play poker, I wouldn't know how to figure this instruction:

Use the methods you developed to write an application that deals two five-card poker hands, evaluates each hand and determines which is the better hand.


I did my own research and saw that there are different types of hands that can come up when dealing a five-card poker hand: a pair, two pairs, three of a kind , four of a kind , a flush , a straight , a full house.

I want to know which ones get get a high rating or low rating and what if none of those hands above appear what would be the rating of the hand?

Thanks

Share this post


Link to post
Share on other sites

we just had that problem like a few weeks ago. in my major subject, we do programming challenges so some of the students in class could be chosen as contestants in an international contest.

 

so here's the specs:

poker hands

 

a poker deck contains 52 cards. each card has a suit of either clubs, diamonds, hearts or spades. each card also has a value of either 2 through 10, jack, queen, king, or ace.

 

a poker hand consists of five cards dealt from the dech. poker hands are ranked by the following partial order from lowest to highest.

 

high card. hands which do not fit any category are ranked by the value of their highest card. if the highest cards have the same value, the hands are ranked by the next highest, and so on.

 

pair. two of the five cards in the hand have the same value. hands which both contain a pair are ranked by the value of the cards forming the pair. if these values are the same, the hands are ranked by the values of the cards not forming the pair, in decreasing order.

 

two pairs. the hand contains two different pairs. hands which both contain two pairs are ranked by the value of their highest pair. hands with the same highest pair are ranked by the value of their other pair. if these values are the same, the hands are ranked by the value of the remaining card.

 

three of a kind. three of the cards in the hand have the same value. hands which both contain three of a kind are ranked by the value of the three cards.

 

straight. hand contains five cards with consecutive values. hands which both contain straight are ranked by their highest card.

 

flush. hand contains five cards of the same suit. hands which are both flushes are ranked using the rules for high card.

 

full house. three cards of the same value, with the remaining two cards forming a pair. ranked by the value of the three cards.

 

four of a kind. four cards with the same value. ranked by the value of the four cards.

 

straight flush. five cards of the same suir with consecutive values. ranked by the highest card in the hand.

 


that specs assumes that the suits have no impact on value. i've played poker before but i think it's a different variation over the original poker. the one i've played also uses the suits and the ranking from lowest to highest is clubs, spades, hearts, and diamonds. i don't know if the real poker game follows this style, but you could still search for it over the net.

 

hope this helps.

Share this post


Link to post
Share on other sites

thanks, it did help. But here's another thing I can't quite figure out:

Modify the application you developed so that it can simulate the dealer. The dealer's five-card hand is dealt "face down," so the player cannot see it. The application should then evaluate the dealer's hand, and, based on the quality of the hand, the dealer should draw one, two or three more cards to replace the corresponding number of unneeded cards in the original hand. The application should then reevaluate the dealer's hand.


What does is mean by "UNNEEDED CARDS"?
Edited by Jeune (see edit history)

Share this post


Link to post
Share on other sites

Just like when you play, you have unneeded cardslets say your trying for a straight. you have a 3, 4 5, King, and a 7. The King would be your unneeded card because you dont need that for a straight, so you would draw a card to replace it hoping that it would be a six. Hope i helped >.<

Share this post


Link to post
Share on other sites

I have a programming assignment involving a poker card game. But since I don't play poker, I wouldn't know how to figure this instruction: I did my own research and saw that there are different types of hands that can come up when dealing a five-card poker hand: a pair, two pairs, three of a kind , four of a kind , a flush , a straight , a full house.

I want to know which ones get get a high rating or low rating and what if none of those hands above appear what would be the rating of the hand?

Thanks

you realy want to programm a poker game ? a online poker game?
do you have a clue how much time this will take? you would need a own server wich is verry expensive i know many people who tryed to programm a online poker by there self and nobody has realeased a beta version till now i dont think you going to manage this when you dont know in wich way the cards are rated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.