Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Texas Hold'em poker game {hand outcome}
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bass3p




PostPosted: Fri Dec 14, 2007 10:47 pm   Post subject: Texas Hold'em poker game {hand outcome}

im trying to make a texas hold'em poker game and im unsure about what the most efficient method of determining the best hand outcome is, can someone give me any suggestions as to how i would go about doing this? right now i have down the dealing of the player & computer cards, burning the cards and the dealing of the flop, turn and river without any duplicate cards
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Fri Dec 14, 2007 10:56 pm   Post subject: RE:Texas Hold\'em poker game {hand outcome}

You have to define each winning set, order them from least valuable to most and see which matches a given hand. Think probability.
Nick




PostPosted: Fri Dec 14, 2007 11:11 pm   Post subject: RE:Texas Hold\'em poker game {hand outcome}

I say have two varibles one for type another for value

so a pair would have a type of one and pair of kings would have a value of 12

then check to see which type beats which and if type's tie then check to see which has higher value
bass3p




PostPosted: Sat Dec 15, 2007 12:08 am   Post subject: Re: Texas Hold'em poker game {hand outcome}

er, didnt say it clearly in my description but what i meant was how to figure the end result by combining your hand with the community cards like if you had jack 10 and the cards on the board were 10 king king jack 4, is there an efficient method for the computer to figure out that the best hand is two jacks, two kings and a 10? i basically need help on figuring out what the most efficient way is, for the program, to figure out if whether the best hand you can form is a pair, two pairs, full house, flush, etc and how it would figure out if you had a pair, fullhouse etc.
Nick




PostPosted: Sat Dec 15, 2007 12:15 am   Post subject: RE:Texas Hold\'em poker game {hand outcome}

hmmm try a for decreasing loop in each run check the number if number = 13 then check for a royal flush if not then the loop repeats at 12 check for etc... if the hand exists then assign the value and exit the loop
chrisciscoioio




PostPosted: Sat Dec 15, 2007 12:20 am   Post subject: Re: Texas Hold'em poker game {hand outcome}

Yes,

Well sorta...

Assign each card a value, higher card higher value, now you sort through cards on the table, if the player has matched with those cards pick those, or for all the other types of hands, otherwise just grab the highest value cards for the rating.

Then you can also do it like a way I built a poker in C++ one time.

You give every card a value as before, and then you set the values of what certain hands are worth, so a Flush would be 10 + 10 + 11 + 12 +13, if it is a royal flush, double it, to make it stand out.

I will see if I can find my C++ poker, it is not the same language, but I will be able to exclain it better, I wrote it almost 4 years ago.
Tony




PostPosted: Sat Dec 15, 2007 12:31 am   Post subject: RE:Texas Hold\'em poker game {hand outcome}

you should probably have some sort of a lookup table, that orders hands in value.

so you just take your seven cards (5 on table + 2 in hand), sort them (easier to do comparisions against a sorted set), and go down the lookup table. First match should be your highest.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: