     bitxor values-table nth ;
 
 : hand-value ( cards -- value )
-    dup flush? [ flushes-table lookup ] [
-        dup unique5-table lookup dup 0 > [ nip ] [
+    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 RANK_STR nth ;
+    -8 shift 0xF bitand RANKS nth ;
 
 : >card-suit ( card -- string )
     {

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"
    "Straight" "Three of a Kind" "Two Pair" "One Pair" "High Card" }

: 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-bit ( rank -- n )
    RANK_STR index 1 swap shift ;

: card-bitfield ( rank rank suit rank -- n )
    {

    infimum first2 ;

: value>string ( n -- string )
    value>rank VALUES nth ;

: hand>card-names ( hand -- string )
    [ card>string ] map ;
