poker handrecogition algorithm

Hi,

a year ago, i started a poker game in C++. At that time i worked as a professional C++ programmer so that was the reason i choose C++. I stopped working on the game just as i was doing some testing for hand recognition. Now i’m going to try to make the game in Java as i currently program a lot in Java.
Besides java looks like improved c++ to me :slight_smile:

Hey, i might never finish the game but i just love poker.
And there aren’t that many Belgian poker players so a net poker game would be cool.
I am also going to make a “game” constructor: this is a part of the game where you construct your own poker variant so you’re not stuck with omaha high low or 5 card draw.

Anyway, on to my question: does anybody know of hand evalution functions in java? Or even general algorithms. The problem with letting people design their own games is that you will end up with stuff like deuces wild, or 3’s and 9’s wild as in baseball.

Then it gets complicated to evaluate the hand and to figure out what hand is the highest. Also, for some games you need to find the lowest hand.
This is the only part of the game i’m not sure about. How can i evaluate a hand properly even if it consists of wildcards?
Anyone has an idea?

I’m sure that this was a problem that was given during the contests at topcoder.com which means that it is available in the practice areas now and that there are likely hundreds of solutions in a database over there. I’m not sure about the legality of using one of the solutions for your own project though. And it may take some time to find the problem set that had this particular issue.

Thanks for the info. I’ll look over at the topcoder site and see if i can come up with something.

swpalmer,

i checked the site but i didn’t find this practice area you speak of. Can you point me in the right directio?

Tx

You have to register, fire up the competition arena application (There is a webstart link there somewhere) then you can use that application to go to the practice rooms and view the solutions that others have submitted.