Options are provided for printing headers and footers, providing a seed, and for generating dealing guides after the hand records that may be useful for preparing the game boards. In Version 2.0, the output may be written as Adobe Postscript (option -a).
A sample of the (ASCII) program output is as follows:
Bd 1 S KQT42 | Bd 2 S T | Bd 3 S 2 Dlr N H AK52 | Dlr E H 95 | Dlr S H AT97 Vul None D 72 | Vul N-S D AKQJ973 | Vul E-W D KJT853 C A9 | C 932 | C 52 S 86 S J973 | S 8654 S Q97 | S JT84 S A93 H T863 H QJ9 | H KQT2 H A84 | H KQ82 H 53 D KQ94 D 86 | D 8 D 542 | D 94 D AQ76 C Q76 C KJ82 | C JT64 C Q875 | C J98 C KQ76 S A5 | S AKJ32 | S KQ765 H 74 | H J763 | H J64 D AJT53 | D T6 | D 2 C T543 | C AK | C AT43 ------------------------------+-------------------------------+----------------------------- ...I have no sample of the Postscript output of the program (yet) for this document, but there are some cosmetic differences, as follows. The lines between hands are drawn instead of built with bars, hyphens and plusses. The suit symbols are drawn from the Symbol font instead of using SHDC. The Heart and Diamond symbols are outlines. Times-Roman is used for headers, footers, and the titles inside each hand box. Fixed-pitch Courier remains for the actual card designations, with 'T' for the 10 card. Using a fixed-pitch font for the card allows you to more easily see distributions at a glance, unlike the new style of ACBL hand record which uses a proportional font for card designations.
There are two style options for dealing guides. Both options are based on having an unshuffled deck in which the Ace of Spades is the top card, King next, down to the deuce. The Spade suit is followed by the Heart suit in the same order, which is followed by Diamonds, which is followed by Clubs.
(At my club games I have the players sort my boards after the game into sorted suits, with the cards placed face up in the duplicate boards.)
The -p dealing guide format was suggested by Gary Porter, though it has probably been in use by other program developers in the past. With the -p option, hands will print this dealing guide for the above three hands:
Another dealing guide option is -q (no mnemonic for either of these I'm afraid), which changes the NSew markers to text arrows, using ^v>< characters, as follows:
Before putting the hands into play, I tested the shuffling and dealing
algorithms to verify that the order of the cards in the deck had a
flat random distribution. I have not tested these deals to see if
the resulting hands meet expected distribution frequencies, but my
anecdotal experience with them is that they are quite excellent.
Naturally, bridge players (especially newer players) are very suspicious
of computer-dealt bridge hands. Their suspicion is somewhat akin to
a superstitious belief that pre-dealt bridge hands must be set up
to give them troubles.
As with duplicate games in which the boards are well shuffled, you
will have occasions when the hands in play are more distributional
than usual, or more flat than usual, or any number of other
coincidences that are perfectly normal for such a tiny selection
of truly random hands. In my personal experience, I don't believe
I've ever attended a club game where someone didn't say to me,
"The hands have been really strange today!" That's a sign to me
that the hands are perfectly normal. :)
About the Dealing Algorithm
The dealing algorithm used was borrowed with permission from Matthew
Clegg's OKBRIDGE program, along with his data types for representing
bridge deals. The deck is randomly shuffled and dealt in a rotation to
the four players.
The dealing algorithm is highly dependent on the quality of the random
number generator(RNG). I suspect that the RNG from the MS-DOS C
Library is only a 16-bit routine, and I consider it only barely
suitable for generating hands. In the Sun version of the program,
I use a 48-bit RNG that is provided with the Solaris libraries. This
would be the preferred environment for generating bridge hands with
this program.Options
These options may be specified on the command line:
Example
With the printer set for 12-pitch fixed-pitch printing, this command line will generate
four pages of output, two pages with hand records, suitable for copying back to back on
a single 8 1/2" x 11" sheet, and two pages of dealing guides using arrows:
hands -h "San Jose Bridge Center, June 16, 1995" -f "Morris Jones, (408) 369-1710" -q >prn
Get the Latest
These archive files include C language source and executable programs
for the following platforms. If you port the program to another
platform, I'd be delighted to offer it here as well, though you
should find that the program compiles easily on any Gnu-compatible
platform.
I strongly recommend against using the DOS 16-bit version of the program. I do not feel that the standard Microsoft 16-bit C Library rand() function is adequate. Look for a good Unix system to run the program (Linux and FreeBSD are often easy to find).
Version 2.0: