Texas Hold'em Poker hand evaluator
Posted: Sat Aug 02, 2008 5:32 am
Well, I've been intrigued by the texas hold'em poker craze, but my gameplay sucks pretty bad. So I sat down and tried to put together a poker hand evaluator so I could learn to judge the strength of hands. My first attempt wasn't too bad. It took roughly 16 seconds to evaluate 1 million 7-card hands. The problem was that it wasn't too hard to compare 2 players hands against each other but it become a little ugly when doing more.
I took a look on the net and ran across this website: http://www.suffecool.net/poker/evaluator.html He is using massive look-up tables to shortcut the ranking. The code is pretty easy so I converted it over to purebasic and gave it a shot. It takes about 5 seconds to rank 1 million 7 card hands. Not too shabby.
I've uploaded the converted code for everyone here: http://www.slightlystunned.com/purebasic/pokertest2.pb
My next step is to set it up so it can judge the relative strength of a hand at the various betting points in texas hold'em and then maybe make a little toy AI for me to play against.
I took a look on the net and ran across this website: http://www.suffecool.net/poker/evaluator.html He is using massive look-up tables to shortcut the ranking. The code is pretty easy so I converted it over to purebasic and gave it a shot. It takes about 5 seconds to rank 1 million 7 card hands. Not too shabby.
I've uploaded the converted code for everyone here: http://www.slightlystunned.com/purebasic/pokertest2.pb
My next step is to set it up so it can judge the relative strength of a hand at the various betting points in texas hold'em and then maybe make a little toy AI for me to play against.