Poker Hands in Java

Ben B. picture Ben B. · Mar 5, 2011 · Viewed 9.4k times · Source

Is there any easy method to compare two poker hands? I'm going about this pretty naively, so if anybody has experience doing this, it could be helpful.

Answer

Matthew Willis picture Matthew Willis · Mar 5, 2011

There isn't an easy (and performant) way to do this, especially if you want to evaluate five-card subsets of seven-card hands, like in Texas Hold 'em.

You might want to check out pokersource which has some Java bindings.

Edit - an additional resource is the pokerai forums. I found quite a few Java algorithms there. They are regularly run through benchmarks and are often accompanied by enumeration algorithms for Monte Carlo simulation. This appears to be the main post.