K&R Hand Valuation

This K&R algorithm file is from http://www.gg.caltech.edu/~jeff/knr.txt
on Jeff Goldsmith's web site.

Also see the C source code at http://www.gg.caltech.edu/~jeff/knrsource.c

[Notes in brackets tie to BidBase HandVal table ID #'s or are other comments by the author of BidBase. This algorithm has some peculiarities. I've noted them in the text below. Aside from that, K&R makes no adjustments for bidding by other players, as some other valuation methods do. This makes K&R more suitable for evaluating opening bids than for subsequent bidding.]

[One of the major features of K&R is the adjustment for honor points for suit length. A-K-Q are valued 3-2-1 initially, then the 4-3-2-1 honor points are multiplied by the suit length and divided by 10. So Kx is adjusted up by 3/10*2=.6 while K-sixth gets 3/10*6 = 1.8. ]

Recapping the K&R algorithm from the
October 1982 Bridge World pp. 21-23.

Protected high cards:
    A = 3, K = 2, Q = 1  [K1000-1030]

Shortness:
    void = 3, singleton = 2, doubleton = 1 [K1120-1140]
    
    [K1150] Discount first doubleton
          [Although this file, the C source file and the Perl
          source file -- all from Jeff Goldsmith's web site --
          say "Discount first doubleton", the C and Perl code
          actually discount the first distribution point, whether
          a doubleton or not. So a hand with 3 distribution points,
          whether a void, a doubleton and singleton, or 3 doubletons,
          would be worth 3 - 1 = 2.  Jeff Goldsmith confirmed this 
          via email.]
             
    [K1160] 4333 = -.5
          [This is rather bizarre because if the hand is NOT 4333,
          then it has a distribtion point, which is reduced by 1
          at K1150, above, and if it is flat, it is reduced by .5,
          so EVERY hand is reduced by either 1 or .5, for which
          Goldsmith had no explanation.]

Suit quality:
    4321 count divided by 10 * number of cards in suit
    [K1170-1230 -- instead of calculating this adjustment
     by suit, BidBase does it by card. E.g.: For AQ32,
     instead of 6/10*4 = 2.4 as specified above, BB does:
     4/10*4 + 2/10*4 = 1.6 + .8 = 2.4, etc. ]

    Adjustments to the 4321 count (before dividing by 10 and
    and * by #cards):
        Seven card suits: missing Q or J (+1)
          [K1070: -Q, -J = 1/10*7 = +.7 ]
        Eight card suits: missing Q (+2 with or w/o J) or J (+1)
          [K1270: -Q = 2/10*8 = +1.6]
          [K1280: *Q & -J = 1/10*8 = +.8 --
               If the Q is missing, we add 2 (actually, 1.6),
               regardless of the J, so add +1 only if the
               J is missing when the Q is NOT missing.
               If we just had "-J", then when QJ were both
               missing, the program would use both 15 & 16.
               Also note that you must use the asterisk
               because just "Q & -J" would only be true with
               Q and no higher.]

        Nine or longer:   missing QJ (+3) or Q (+2) or J (+1)
          [K1240: -Q & -J -- both Q & J are missing]
          [K1250: -Q & *J -- only Q is missing]
          [K1260: *Q & -J -- only J is missing]
          [Note: +3/10 * suit len - 8, etc.]

        For Intermediates in six-card suits or shorter:
            Ten with two honors: 1
              [K1210: ??J, ???J -- Although this file says "with
                two honors, the C source shows 2 *or more*.]

            Ten with the Jack:   1
              [K1210: *JT -- any JT combo]

            Other tens:          .5
              [K1220:  T, ?T & -JT -- Either Ten and no higher
                     or T with 1 higher except J, which was
                     counted in 21, above.]

                (modifier about six-card suits misplaced?)
                [No idea what the line above means.]
                [K1230: ??9, *T9, *98 = .5/10* suit len]

Short honors:
    stiff king = .5
    [K1050: K is counted for 2 pts in #2, so we deduct 1.5]

    doubleton queen if with A or K = .5
    [K1070: ?Q is either AQ or KQ. ]

    stiff Q or Qx = 0
    [K1060: stiff Q]  [8: Qx]


Lower honors:
    Queen if without ace or king and suit is 3 or longer = -.25
    [K1090: Qxx+ ]

    J with exactly two higher honors = .5
    [K1010: ??J in 4-card suit (protected honor)]

    J with exactly one higher honor  = .25
    [1110: ?J in 4-card suit (protected honor)]
    [ Odd that in AKQJ or Jxxx, the J gets nothing.]

    Doubleton queen = .25
        [BB counts Q as 1 in K1030,
         AQ/KQ deducts .5 in K1070,
            Qx deducts  1 in K1060.
         Don't understand why another .25 is added here.]

    Ten under two higher or with 9 and one higher = .25
     [K1040: ??T or ?T9 -- Under "Suit Quality", when it says
            "Ten with two higher", the C source code shows
            two *or more*, so you would think that would also
            be the case here, especially since right above they
            explicitly refer to a J with "exactly two higher",
            yet in the C source, the calculation shows Ten and
            *exactly* two higher, not two or more.]


Use of K&R Points:
    1H, 1S, 1NT opening optional at 12.0
                        mandatory   12.5
    1C, 1D      opening optional at 13.0
                        mandatory   13.5
    2C with major                   22.0
    2C with minor                   24.0