CKCNumber

Type Alias CKCNumber 

Source
pub type CKCNumber = u32;
Expand description

A PokerCard is a u32 representation of a variant of Cactus Kev’s binary representation of a poker card as designed for rapid hand evaluation as documented here.

The variation being that the Suit bits order is inverted for easier sorting.

+--------+--------+--------+--------+
|mmmbbbbb|bbbbbbbb|SHDCrrrr|xxpppppp|
+--------+--------+--------+--------+

p = prime number of rank (deuce=2,trey=3,four=5,...,ace=41)
r = rank of card (deuce=0,trey=1,four=2,five=3,...,ace=12)
SHDC = suit of card (bit turned on based on suit of card)
b = bit turned on depending on rank of card
m = Flags reserved for multiples of the same rank. Stripped for evals.

Trait Implementations§