Computer Cribbage
Computer cribbage programs were created soon after the development of the FORTRAN programming language. With the advent of a more user-friendly programming language, BASIC and the internet, computer cribbage programs became commercially available.
Any program worth having must be able to compute the best keep of any 6-card holding. The better programs may discard differently, depending on who the dealer is. HALSCRIB and REX CRIBBAGE as of this writing is the only program to use board position AND pegging efficiency in discarding.
Most programs have rules for making pegging decisions but neglect the pegging efficiency of the keep. When either or both players are at hole 115 or higher - the OUT Zone - pegging efficiency is at its most importance!
HALSCRIB and REX CRIBBAGE use board position and pegging efficiency in choosing discards and pegging plays. Although the keep candidates are evaluated on the fly, the pegging efficiency, for both offense and defense, are stored in static look-up tables for each 4-card keep and then dynamically modified according to the discards. Potential opponent discard frequencies are also stored in static look-up tables that are dynamically modified according to the 6-card holding. No other program does so!
Pegging decisions are made by considering each card and then consecutively examining all possible pegging sequences for each possible opponent holding. All playable combinations of both players' cards are hypothetically played out. In the play-out, each player chooses a pegging card that maximizes their points and minimizes opponent's resulting in a 'mini-max' decision at each level in the play-out tree starting from the last card played, back to the first. This method is known as a "full-depth" pruning search.
Each possible opponent holding has a frequency of occurrence that is stored in a static look-up table which is dynamically modified according to the dealt hand, starter and opponent's played cards. This frequency is then used to weight the 'pruned' potential pegging point values of both players and then accumulated. The pegging candidate is chosen from the accumulated totals depending on whether HAL intends to maximize his points or minimize opponent's. NOTE that when you click on VIEW-HANDS, VIEW-KEEP TOSS, VIEW-MIN MAX, VIEW-PEG, and VIEW WIN LOSS in MODE-TRAINING the numbers are calculated from your perspective.
HALSCRIB has extensive external look-up tables. There are about 50 pegging tables (25 for each player) and 50 hand frequency tables (25 for each player) that could be used. The hand frequency tables DEALXX8.TBL, PONEXX8.TBL, and the pegging tables DEALXX8.PEG and PONEXX8.PEG are used when neither player is at hole 115 or higher - the OUT Zone. Note that the frequency of occurrence of a hand in the OUT Zone may be considerably different from the normal occurrence thereby affecting its pegging efficiency as well.
Once either player is in the OUT Zone, the tables are replaced according to how far dealer and pone are distant from hole 120. DEAL508.TBL and PONE508.TBL would be used when dealer is at hole 115 and pone at hole 120, and would replace the 'normal' hand frequency tables. Similarly, DEAL508.PEG and PONE508.PEG would replace the pegging efficiency look-up tables.
REX CRIBBAGE has the above tables (labelled xxxxXX9.TBL), but in addition has an additional 50 static keep pegging probability tables when one player is in the OUT ZONE (holes 115 and higher) and the other player is in the OVER ZONE (holes 85-90); eg DEALA09.TBL for dealer at hole 90 and pone at hole 120). Unlike HALSCRIB, REX CRIBBAGE factors in the pegging-out/over potential of both players in choosing discards.
When dealer is at hole 106 or higher, or pone is at hole 111 or higher, that player is in the WIN Zone. When in this zone, HALSCRIB and REX CRIBBAGE calculate precise probabilities of losing, winning, pegging out, counting out, skunking opponent, skunk avoidance by pegging over and by counting over. In this zone, VIEW-PEG displays exact probabilities for these by pegging out ONLY and VIEW-WIN LOSS displays exact probabilities for these by counting out.

























