 CONSTANT: ONE_PAIR         7
 CONSTANT: HIGH_CARD        8
 
-CONSTANT: SUIT_STR { "C" "D" "H" "S" }
-
-CONSTANT: RANK_STR { "2" "3" "4" "5" "6" "7" "8" "9" "T" "J" "Q" "K" "A" }
-
-CONSTANT: VALUE_STR { "Straight Flush" "Four of a Kind" "Full House" "Flush"
+CONSTANT: SUITS { "C" "D" "H" "S" }
+
+CONSTANT: RANKS { "2" "3" "4" "5" "6" "7" "8" "9" "T" "J" "Q" "K" "A" }
+
+CONSTANT: VALUES { "Straight Flush" "Four of a Kind" "Full House" "Flush"
     "Straight" "Three of a Kind" "Two Pair" "One Pair" "High Card" }
 
+: card-suit ( suit -- n )
+    SUITS index 3 swap - 2^ ;
+
+: card-rank ( rank -- n )
+    RANKS index ;
+
 : card-rank-prime ( rank -- n )
-    RANK_STR index { 2 3 5 7 11 13 17 19 23 29 31 37 41 } nth ;
-
-: card-rank ( rank -- n )
-    {
-        { "2" [ DEUCE ] }
-        { "3" [ TREY  ] }
-        { "4" [ FOUR  ] }
-        { "5" [ FIVE  ] }
-        { "6" [ SIX   ] }
-        { "7" [ SEVEN ] }
-        { "8" [ EIGHT ] }
-        { "9" [ NINE  ] }
-        { "T" [ TEN   ] }
-        { "J" [ JACK  ] }
-        { "Q" [ QUEEN ] }
-        { "K" [ KING  ] }
-        { "A" [ ACE   ] }
-    } case ;
-
-: card-suit ( suit -- n )
-    {
-        { "C" [ CLUB    ] }
-        { "D" [ DIAMOND ] }
-        { "H" [ HEART   ] }
-        { "S" [ SPADE   ] }
-    } case ;
+    card-rank { 2 3 5 7 11 13 17 19 23 29 31 37 41 } nth ;
 
 : card-rank-bit ( rank -- n )
-    RANK_STR index 1 swap shift ;
+    card-rank 2^ ;
 
 : card-bitfield ( rank rank suit rank -- n )
     {

PRIVATE>

: <deck> ( -- deck )
    RANK_STR SUIT_STR 2array
    [ concat >ckf ] V{ } product-map-as randomize ;

: best-holdem-hand ( hand -- n cards )

    bitxor values-table nth ;

: hand-value ( cards -- value )
    dup flush? [
        flushes-table lookup
    ] [
        dup unique5-table lookup dup 0 > [
            nip
        ] [
            drop prime-bits perfect-hash-find
        ] if
    ] if ;

: >card-rank ( card -- string )
    -8 shift 0xF bitand RANKS nth ;

: >card-suit ( card -- string )
    {
