Question

In an effort to create the fastest possible monte carlo texas hold'em hand analyzer with C++, I am currently looking into the subject of hand evaluation.

As many of you may know, there are quite a number of hand evaluators, open source, out there. After giving it some thought, I settled on the "Two Plus Two hand evaluator" (so named since it was first introduced on the two plus two forum).

This is one of the fastest known evaluators out there, and uses array lookups to quickly find the value of a hand.

Now, for the function, you need to pass in an array with the cards you are interested in. Example:

int Cards[] = { 3, 5, 10, 17, 23, 24, 32 };
int hv = HandValue(Cards);

With values between 1 and 52. Now, my question is: What cards do these integers correspond to? Is a 3 an ace of spades? A three of hearts? I have scoured google, the two + two forum, various pages where hand evaluators are presented, the source file for the build-up of the array. All in vain. So I am hoping that someone here can point me in the right direction of where I can find this information, or give it to me outright.

The source where the evaluators are taken from is this excellent article: http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup#cactus_kev Which explains all the evaluators individually.

Was it helpful?

Solution

I didn't verify this, but it appears to be:

"2c": 1,
"2d": 2,
"2h": 3,
"2s": 4,
"3c": 5,
"3d": 6,
...
"kh": 47,
"ks": 48,
"ac": 49,
"ad": 50,
"ah": 51,
"as": 52

ref: https://github.com/chenosaurus/poker-evaluator/blob/master/lib/PokerEvaluator.js

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top