Documentation ¶
Overview ¶
Package gophe implements a Texas-Holdem Poker Hand Evaluator based on HenryRLee's implementation using a Perfect Hash Algoritihim. It currently handles hands of 5-7 cards, and uses pre-computed hash tables (I reformatted HenryRLee's into go files) to evaluate hands extremely fast.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Choose = [53][10]uint32{
{
1, 0, 0, 0, 0,
0, 0, 0, 0, 0,
},
{
1, 1, 0, 0, 0,
0, 0, 0, 0, 0,
},
{
1, 2, 1, 0, 0,
0, 0, 0, 0, 0,
},
{
1, 3, 3, 1, 0,
0, 0, 0, 0, 0,
},
{
1, 4, 6, 4, 1,
0, 0, 0, 0, 0,
},
{
1, 5, 10, 10, 5,
1, 0, 0, 0, 0,
},
{
1, 6, 15, 20, 15,
6, 1, 0, 0, 0,
},
{
1, 7, 21, 35, 35,
21, 7, 1, 0, 0,
},
{
1, 8, 28, 56, 70,
56, 28, 8, 1, 0,
},
{
1, 9, 36, 84, 126,
126, 84, 36, 9, 1,
},
{
1, 10, 45, 120, 210,
252, 210, 120, 45, 10,
},
{
1, 11, 55, 165, 330,
462, 462, 330, 165, 55,
},
{
1, 12, 66, 220, 495,
792, 924, 792, 495, 220,
},
{
1, 13, 78, 286, 715,
1287, 1716, 1716, 1287, 715,
},
{
1, 14, 91, 364, 1001,
2002, 3003, 3432, 3003, 2002,
},
{
1, 15, 105, 455, 1365,
3003, 5005, 6435, 6435, 5005,
},
{
1, 16, 120, 560, 1820,
4368, 8008, 11440, 12870, 11440,
},
{
1, 17, 136, 680, 2380,
6188, 12376, 19448, 24310, 24310,
},
{
1, 18, 153, 816, 3060,
8568, 18564, 31824, 43758, 48620,
},
{
1, 19, 171, 969, 3876,
11628, 27132, 50388, 75582, 92378,
},
{
1, 20, 190, 1140, 4845,
15504, 38760, 77520, 125970, 167960,
},
{
1, 21, 210, 1330, 5985,
20349, 54264, 116280, 203490, 293930,
},
{
1, 22, 231, 1540, 7315,
26334, 74613, 170544, 319770, 497420,
},
{
1, 23, 253, 1771, 8855,
33649, 100947, 245157, 490314, 817190,
},
{
1, 24, 276, 2024, 10626,
42504, 134596, 346104, 735471, 1307504,
},
{
1, 25, 300, 2300, 12650,
53130, 177100, 480700, 1081575, 2042975,
},
{
1, 26, 325, 2600, 14950,
65780, 230230, 657800, 1562275, 3124550,
},
{
1, 27, 351, 2925, 17550,
80730, 296010, 888030, 2220075, 4686825,
},
{
1, 28, 378, 3276, 20475,
98280, 376740, 1184040, 3108105, 6906900,
},
{
1, 29, 406, 3654, 23751,
118755, 475020, 1560780, 4292145, 10015005,
},
{
1, 30, 435, 4060, 27405,
142506, 593775, 2035800, 5852925, 14307150,
},
{
1, 31, 465, 4495, 31465,
169911, 736281, 2629575, 7888725, 20160075,
},
{
1, 32, 496, 4960, 35960,
201376, 906192, 3365856, 10518300, 28048800,
},
{
1, 33, 528, 5456, 40920,
237336, 1107568, 4272048, 13884156, 38567100,
},
{
1, 34, 561, 5984, 46376,
278256, 1344904, 5379616, 18156204, 52451256,
},
{
1, 35, 595, 6545, 52360,
324632, 1623160, 6724520, 23535820, 70607460,
},
{
1, 36, 630, 7140, 58905,
376992, 1947792, 8347680, 30260340, 94143280,
},
{
1, 37, 666, 7770, 66045,
435897, 2324784, 10295472, 38608020, 124403620,
},
{
1, 38, 703, 8436, 73815,
501942, 2760681, 12620256, 48903492, 163011640,
},
{
1, 39, 741, 9139, 82251,
575757, 3262623, 15380937, 61523748, 211915132,
},
{
1, 40, 780, 9880, 91390,
658008, 3838380, 18643560, 76904685, 273438880,
},
{
1, 41, 820, 10660, 101270,
749398, 4496388, 22481940, 95548245, 350343565,
},
{
1, 42, 861, 11480, 111930,
850668, 5245786, 26978328, 118030185, 445891810,
},
{
1, 43, 903, 12341, 123410,
962598, 6096454, 32224114, 145008513, 563921995,
},
{
1, 44, 946, 13244, 135751,
1086008, 7059052, 38320568, 177232627, 708930508,
},
{
1, 45, 990, 14190, 148995,
1221759, 8145060, 45379620, 215553195, 886163135,
},
{
1, 46, 1035, 15180, 163185,
1370754, 9366819, 53524680, 260932815, 1101716330,
},
{
1, 47, 1081, 16215, 178365,
1533939, 10737573, 62891499, 314457495, 1362649145,
},
{
1, 48, 1128, 17296, 194580,
1712304, 12271512, 73629072, 377348994, 1677106640,
},
{
1, 49, 1176, 18424, 211876,
1906884, 13983816, 85900584, 450978066, 2054455634,
},
{
1, 50, 1225, 19600, 230300,
2118760, 15890700, 99884400, 536878650, 2505433700,
},
{
1, 51, 1275, 20825, 249900,
2349060, 18009460, 115775100, 636763050, 3042312350,
},
{
1, 52, 1326, 22100, 270725,
2598960, 20358520, 133784560, 752538150, 3679075400,
},
}
View Source
var RankCategoryDescription = [11]string{
"s",
"Straight Flush",
"Four Of a Kind",
"Full House",
"Flush",
"Straight",
"Three Of a Kind",
"Two Pair",
"One Pair",
"High Card",
}
View Source
var RankDescription = [7463][2]string{}/* 7463 elements not displayed */
Functions ¶
func DescribeRank ¶
func DescribeRankCategory ¶
func DescribeRankCategory(category RankCategory) string
func DescribeSampleHand ¶
Types ¶
type Hand ¶
type Hand struct {
// contains filtered or unexported fields
}
func (*Hand) ModifyHand ¶
type Rank ¶
type Rank struct {
// contains filtered or unexported fields
}
func EvaluateCards ¶
func EvaluateHand ¶
func (Rank) DescribeCategory ¶
func (Rank) DescribeRank ¶
func (Rank) DescribeSampleHand ¶
func (Rank) GetCategory ¶
func (r Rank) GetCategory() RankCategory
type RankCategory ¶
type RankCategory uint8
const ( StraightFlush RankCategory = iota + 1 FourOfAKind FullHouse Flush Straight ThreeOfAKind TwoPair OnePair HighCard )
func GetRankCategory ¶
func GetRankCategory(rank uint16) RankCategory
Source Files ¶
Click to show internal directories.
Click to hide internal directories.