[comp.sources.games] v06i006: bidding2 - Bridge Bidder, Version 2.0

games@tekred.CNA.TEK.COM (02/14/89)

Submitted by: Nathan Glasser <nathan@eddie.mit.edu>
Comp.sources.games: Volume 6, Issue 6
Archive-name: bidding2

[[This is an updated version of my bridge bidding program. The changes since
version 1.0 are mostly cosmetic, but will probably be appreciated
by most of those who used it regularly in the past.

It should compile as is on most versions of Unix, as well as for
the IBM-pc/ms-dos (using msc5.0, at least).

				- Nathan]]

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  bidding_new bidding_new/bidding.c bidding_new/bidding.doc
#   bidding_new/bidding.h bidding_new/deal.c bidding_new/makefile.dos
#   bidding_new/makefile.unx bidding_new/readme.doc
# Wrapped by nathan@brokaw on Wed Feb  8 14:55:10 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'bidding_new' ; then
    echo shar: Creating directory \"'bidding_new'\"
    mkdir 'bidding_new'
fi
if test -f 'bidding_new/bidding.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/bidding.c'\"
else
echo shar: Extracting \"'bidding_new/bidding.c'\" \(10323 characters\)
sed "s/^X//" >'bidding_new/bidding.c' <<'END_OF_FILE'
X/* bidding.c */
X/*
X			Bridge Bidder	Version 2.0
X			by Nathan Glasser
X			nathan@brokaw.lcs.mit.edu (internet)
X			nathan@mit-eddie.uucp (usenet)
X
X			February, 1989
X------------------------------------------------------------------------------
XCopyright 1988, 1989 by Nathan Glasser.
XYou may feel free to distribute this program in its current form.
XPlease do not remove this copyright information.
X*/
X
X#include "bidding.h"
X
Xint num_hands = DEF_NUM_HANDS;
X
Xchar *vuln_relative[] = {"YOUR SIDE","OTHER SIDE"};
Xchar *vuln_absolute[] = {"1ST SIDE","2ND SIDE","NEITHER SIDE","BOTH SIDES"};
Xchar *suit_strings[4] = {"SPADES","HEARTS","DIAMONDS","CLUBS"};
Xchar *vuln_format[2][2] = {
X  {"DECLARER SIDE","DEFENDER SIDE"},
X  {"VERTICAL SIDE","HORIZONTAL SIDE"}};
X
X#define PASSED_OUT(pdeal) \
X    ((pdeal)->num_bids == 4 && (pdeal)->bids->bid.suit == PASS)
X
Xmain(argc,argv)
Xint argc;
Xchar **argv;
X{
X    deal *deals;
X    int i,j;
X    int num_hands_left;
X    int hand_num;
X
X    if (argc > 1)
X	num_hands = atoi(argv[1]);
X    printf("Dealing %d hands...\n",num_hands_left = num_hands);
X
X    deals = (deal *)malloc(num_hands * sizeof(deal));
X
X    srandom((unsigned)time(NULL));
X
X    for (i = 0; i < num_hands; i++)
X	deal_hands(&deals[i]);
X
X    /* Accept bids */
X    while (num_hands_left)
X    {
X	hand_num = random() % num_hands;
X
X	if (deals[hand_num].bidding_done)
X	    continue;
X	clear_screen();
X
X        for (;;)
X        {
X            print_bidding(stdout,&deals[hand_num],-2);
X            printf("YOUR HAND (%s VULNERABLE):\n",
X              (deals[hand_num].vulnerability <= RELATIVE) ?
X              vuln_relative[(deals[hand_num].num_bids & 1) ^ 
X              deals[hand_num].vulnerability] :
X              vuln_absolute[deals[hand_num].vulnerability]);
X            print_hand(stdout,
X              deals[hand_num].hands[deals[hand_num].num_bids % 4]);
X            if (!accept_bid(&deals[hand_num]))
X                break;
X            printf("Bad bid.\n\n");
X        }
X
X	if (deals[hand_num].bidding_done)
X	{
X	    num_hands_left--;
X	    /* If hand was passed out */
X	    if (PASSED_OUT(&deals[hand_num]))
X	        display_complete_deal(&deals[hand_num],0);
X	}
X    }
X
X    /* Accept opening leads */
X    for (hand_num = 0; hand_num < num_hands; hand_num++)
X    {
X    	/* Make sure hand wasn't passed out */
X	if (PASSED_OUT(&deals[hand_num]))
X	    continue;
X	clear_screen();
X	j = figure_out_leader(&deals[hand_num]);
X
X        for (;;)
X        {
X            print_bidding(stdout,&deals[hand_num],j);
X            printf("YOUR HAND (%s VULNERABLE):\n",
X              (deals[hand_num].vulnerability <= RELATIVE) ?
X              vuln_relative[(j & 1) ^ 
X              deals[hand_num].vulnerability] :
X              vuln_absolute[deals[hand_num].vulnerability]);
X            print_hand(stdout,deals[hand_num].hands[j]);
X            if (!get_lead(&deals[hand_num],j))
X                break;
X            printf("Bad lead.\n\n");
X        }
X
X	display_complete_deal(&deals[hand_num],((j + 1) % 4));
X    }
X
X    printf("All bidding complete.\n");
X}
X
Xdisplay_complete_deal(pdeal,top_hand)
Xdeal *pdeal;
Xint top_hand;
X{
X    print_complete_deal(stdout,pdeal,top_hand);
X    more();
X    log_deal(pdeal,top_hand);
X}
X
Xprint_complete_deal(fp,pdeal,top_hand)
XFILE *fp;
Xdeal *pdeal;
Xint top_hand;
X{
X    int i;
X    char top_h[4][80],left_h[4][80],right_h[4][80],bottom_h[4][80];
X
X    format_hand(top_h,pdeal->hands[top_hand]);
X    format_hand(right_h,pdeal->hands[(top_hand + 1) % 4]);
X    format_hand(bottom_h,pdeal->hands[(top_hand + 2) % 4]);
X    format_hand(left_h,pdeal->hands[(top_hand + 3) % 4]);
X    fprintf(fp,"\t\t\tCOMPLETE DEAL (%s VULNERABLE):\n",
X      ((pdeal->vulnerability <= RELATIVE) ?
X      vuln_format[PASSED_OUT(pdeal)][(top_hand & 1) ^ pdeal->vulnerability] :
X      vuln_absolute[pdeal->vulnerability]));
X
X    for (i = 0; i < 4; i++)
X    	fprintf(fp,"\t\t\t%s\n",top_h[i]);
X    for (i = 0; i < 4; i++)
X    	fprintf(fp,"%-43s%s\n",left_h[i],right_h[i]);
X    for (i = 0; i < 4; i++)
X    	fprintf(fp,"\t\t\t%s\n",bottom_h[i]);
X}
X
Xprint_bidding(fp,pdeal,your_position)
XFILE *fp;
Xdeal *pdeal;
Xint your_position;
X{
X    bid *bids;
X    static char *bid_suits[] = {"S","H","D","C","NT","DB","RD","P"};
X    int bid_num = 0;
X    static char *bid_labels[] = {"*You*","LHO","Partner","RHO"};
X    static char *lead_labels[] = {"*You*","Dummy","Partner","Decl."};
X    char **labels;
X    int i;
X
X    if (your_position != -1)
X    {
X    	if (your_position < 0)
X	{
X	    your_position = pdeal->num_bids;
X	    labels = bid_labels;
X	}
X	else
X	    labels = lead_labels;
X
X	putc('\t',fp);
X	for (i = 0; i < 4; i++)
X	    fprintf(fp,"\t%s",labels[(1000 + i - your_position) % 4]);
X    }
X    fprintf(fp,"\nBIDDING:\t--------------------------------\n");
X
X    for (bids = pdeal->bids; bid_num < pdeal->num_bids; bids = bids->next)
X    {
X	if ((bid_num % 4) == 0)
X	    putc('\t',fp);
X	if (bids->bid.suit <= RANK_USED)
X	    fprintf(fp,"\t%d%s",bids->bid.rank,bid_suits[bids->bid.suit]);
X	else
X	    fprintf(fp,"\t%s",bid_suits[bids->bid.suit]);
X	if ((++bid_num % 4) == 0)
X	    putc('\n',fp);
X    }
X    if (bid_num % 4)
X	putc('\n',fp);
X}
X
Xaccept_bid(pdeal)
Xdeal *pdeal;
X{
X    int ch;
X    int rank = -1,suit;
X    bid *newbid;
X    static int suit_cvt[] = {3,2,1,0,4};
X    bid *tmp;
X    int i;
X    
X    printf("\nEnter your bid: ");
X
X    /* Get optional rank */
X    while (isspace(ch = getchar()));
X
X    if (isdigit(ch))
X    {
X	rank = ch - '0';
X	while (isspace(ch = getchar()));
X    }
X
X    /* Get suit, notrump, pass, double, or redouble */
X    if (islower(ch))
X	ch = toupper(ch);
X
X    switch (ch)
X    {
X	case 'S':
X	    suit = SPADES;
X	    break;
X	case 'H':
X	    suit = HEARTS;
X	    break;
X	case 'D':
X	    suit = (rank >= 0) ? DIAMONDS : DOUBLE;
X	    break;
X	case 'C':
X	    suit = CLUBS;
X	    break;
X	case 'N':
X	    suit = NOTRUMP;
X	    break;
X	case 'P':
X	    suit = PASS;
X	    break;
X	case 'R':
X	    suit = REDOUBLE;
X	    break;
X	default:
X	    suit = -1;
X	    break;
X	}
X
X    while (getchar() != '\n');
X    if (suit < 0)
X	return(1);
X
X    /* Make sure numerical bid is ok */
X    if (suit <= RANK_USED)
X    {
X    	if (rank < 1 || rank > 7)
X	    return(1);
X	if (pdeal->num_bids > 0)
X	    for (tmp = pdeal->bids->prev,i = pdeal->num_bids; i;
X	      tmp = tmp->prev, i--)
X		if (tmp->bid.suit <= RANK_USED)
X		{
X		    if (rank < tmp->bid.rank || 
X		      rank == tmp->bid.rank &&
X		      suit_cvt[suit] <= suit_cvt[tmp->bid.suit])
X			return(1);
X		    break;
X		}
X    }
X    /* Make sure double or redouble is valid */
X    else if (suit == DOUBLE || suit == REDOUBLE)
X    {
X	if (pdeal->num_bids <= 0)
X	    return(1);
X    	for (tmp = pdeal->bids->prev,i = pdeal->num_bids; i;
X	  tmp = tmp->prev, i--)
X	    if (tmp->bid.suit != PASS)
X	    {
X	    	/* Double or redouble by wrong side */
X		/* The person bidding in the num_bids position was
X		   an opponent. The last valid bidder must have had
X		   this parity. */
X		if (((i ^ pdeal->num_bids) & 1) == 1)
X		    return(1);
X		/* Double of a double or redouble */
X		if (suit == DOUBLE && tmp->bid.suit > RANK_USED)
X		    return(1);
X		/* Redouble of a bid other than double */
X		if (suit == REDOUBLE && tmp->bid.suit != DOUBLE)
X		    return(1);
X		break;
X	    }
X	/* Double or redouble as first non-pass bid */
X	if (!i)
X	    return(1);
X    }
X
X    newbid = (bid *)malloc(sizeof(bid));
X    newbid->bid.rank = rank;
X    newbid->bid.suit = suit;
X
X    if (++(pdeal->num_bids) == 1)
X	newbid->next = newbid->prev = pdeal->bids = newbid;
X    else
X    {
X	(newbid->next = pdeal->bids)->prev = 
X	  (newbid->prev = pdeal->bids->prev)->next = newbid;
X	if (newbid->bid.suit == PASS && newbid->prev->bid.suit == PASS &&
X	  newbid->prev->prev->bid.suit == PASS && pdeal->num_bids >= 4)
X	    pdeal->bidding_done = 1;
X    }
X    return(0);
X}
X
Xmore()
X{
X    printf("---Hit return to continue---");
X    while (getchar() != '\n');
X}
X
Xlog_deal(pdeal,top_hand)
Xdeal *pdeal;
Xint top_hand;
X{
X    FILE *fp;
X    int i;
X
X    if ((fp = fopen(LOGFILE,"a")) == NULL)
X    {
X	perror(LOGFILE);
X	return;
X    }
X    print_bidding(fp,pdeal,figure_out_leader(pdeal));
X    if (pdeal->opening_lead.suit >= 0)
X    	fprintf(fp,"OPENING LEAD: %c of %s\n",pdeal->opening_lead.rank,
X          suit_strings[pdeal->opening_lead.suit]);
X    print_complete_deal(fp,pdeal,top_hand);
X    putc('\n',fp);
X    putc('\n',fp);
X    fclose(fp);
X}
X
Xfigure_out_leader(pdeal)
Xdeal *pdeal;
X{
X    int contract_maker;
X    bid *finalsuit,*tmp;
X    int suit_bidder;
X
X    /* Find out which bid specified the basic contract */
X    for (contract_maker = pdeal->num_bids - 1, finalsuit = pdeal->bids->prev;
X      contract_maker >= 0 && finalsuit->bid.suit > RANK_USED;
X      contract_maker--, finalsuit = finalsuit->prev);
X    if (contract_maker < 0)
X    	return(-1);
X    /* Reduce this to a single side */
X    contract_maker &= 1;
X    /* Find the first player of this side to bid this suit. */
X    suit_bidder = contract_maker;
X    tmp = (suit_bidder) ? pdeal->bids->next : pdeal->bids;
X    while (tmp->bid.suit != finalsuit->bid.suit)
X    {
X    	suit_bidder += 2;
X	tmp = tmp->next->next;
X    }
X    return((suit_bidder + 1) % 4);
X}
X
Xget_lead(pdeal,handnum)
Xdeal *pdeal;
Xint handnum;
X{
X    int rank,suit,i;
X    char *tmp;
X    static char valid_ranks[] = "23456789TJQKA";
X    static char valid_suits[] = "SHDC";
X    
X    printf("\nEnter your opening lead: ");
X
X    /* Get rank */
X    while (isspace(rank = getchar()));
X
X    /* Get suit */
X    while (isspace(suit = getchar()));
X
X    if (islower(rank))
X    	rank = toupper(rank);
X    if (index(valid_ranks,rank) == NULL)
X    {
X    	if (rank == '1' && suit == '0')
X	{
X	    rank = 'T';
X	    /* Get suit again */
X	    while (isspace(suit = getchar()));
X	}
X	else
X	    rank = -1;
X    }
X    if (islower(suit))
X    	suit = toupper(suit);
X    if ((tmp = index(valid_suits,suit)) == NULL)
X    	suit = -1;
X    while (getchar() != '\n');
X    if (rank < 0 || suit < 0)
X    	return(1);
X
X    pdeal->opening_lead.rank = rank;
X    pdeal->opening_lead.suit = tmp - valid_suits;
X
X    /* Check to see if it's in the hand */
X    for (i = 0; i < 13; i++)
X    	if (pdeal->hands[handnum][i].suit == pdeal->opening_lead.suit &&
X	  valid_ranks[pdeal->hands[handnum][i].rank - 2] ==
X	  pdeal->opening_lead.rank)
X	    return(0);
X    return(1);
X}
X
Xclear_screen()
X{
X#ifdef SCREEN_CLEAR_SIZE
X    int i;
X
X    for (i = 0; i < SCREEN_CLEAR_SIZE; i++)
X    	putchar('\n');
X#else
X    putchar('\f');
X#endif
X}
END_OF_FILE
if test 10323 -ne `wc -c <'bidding_new/bidding.c'`; then
    echo shar: \"'bidding_new/bidding.c'\" unpacked with wrong size!
fi
# end of 'bidding_new/bidding.c'
fi
if test -f 'bidding_new/bidding.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/bidding.doc'\"
else
echo shar: Extracting \"'bidding_new/bidding.doc'\" \(2996 characters\)
sed "s/^X//" >'bidding_new/bidding.doc' <<'END_OF_FILE'
X			Bridge Bidder Version 2.0
X			by Nathan Glasser
X			nathan@brokaw.lcs.mit.edu (internet)
X			nathan@mit-eddie.uucp (usenet)
X
X			February, 1989
X------------------------------------------------------------------------------
XCopyright 1988, 1989 by Nathan Glasser.
XYou may feel free to distribute this program in its current form.
XPlease do not remove this copyright information.
X==============================================================================
XThis program lets you practice your bidding and opening leads.
X
XAny conventions you want to use are allowed because you're your own
Xpartner, as well as your own opponents. The idea behind this program
Xis that if you're involved with a large enough number of boards, you
Xhopefully won't remember all the hands of a given board, and so you
Xcan bid each of the four hands at different times. What the program
Xdoes is let you make all the bids in all the hands, one bid at a
Xtime, choosing which board to use at any point randomly and letting
Xyou enter the next bid in its bidding sequence.
X
XIn this way, you get to practice bidding with 3 other players whose
Xbidding you understand completely and a partner whom you trust
Ximplicitly. If you find this not to be the case, then you'll probably
Xhave discovered ways in which you need to better understand your
Xbidding system or in which bidding can otherwise be improved.
X
X(By the way, randomly dealt hands tend to have more unusual
Xdistribution than cards which are shuffled and dealt. Thus you may
Xfind that you're pushing your knowledge of your bidding system to its
Xlimits with some of the hands you'll get.)
X------------------------------------------------------------------------------
XThe operation of the program is as follows:
X
XUsage:	bidding [number of boards]
X
XThe number of boards to deal can be specified on the command line; the
Xdefault is 10.
X
XThe appropriate number of boards are dealt.
X
XYou are shown a single hand, and the bidding of the current board so
Xfar (if there's been any), and you get to enter the next bid.
X
XYou continue in this fashion until the bidding is completed on every hand.
X
XThen you are presented with the hand of the player to make the
Xopening lead on a board, and the bidding of the hand, and get to
Xenter the opening lead.
X
XThe complete hand is then presented to you for your analysis.
X
XYou continue in this fashion until all the hands have been bid and led to.
X
XA complete log of each board is automatically written to the file
X"bidding.log" after the board's completion.
X------------------------------------------------------------------------------
XBids are specified in the obvious way, e.g. 1s = 1 spade, 2n = 2 notrump,
Xp = pass, d = double, r = redouble.
X
XSimilarly, opening leads are specified in the obvious way, e.g.
X2c = 2 of clubs, js = jack of spades, th or 10h = ten of hearts.
X------------------------------------------------------------------------------
XPlease send any comments or bug reports to me at one of the above e-mail
Xaddresses.
END_OF_FILE
if test 2996 -ne `wc -c <'bidding_new/bidding.doc'`; then
    echo shar: \"'bidding_new/bidding.doc'\" unpacked with wrong size!
fi
# end of 'bidding_new/bidding.doc'
fi
if test -f 'bidding_new/bidding.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/bidding.h'\"
else
echo shar: Extracting \"'bidding_new/bidding.h'\" \(1694 characters\)
sed "s/^X//" >'bidding_new/bidding.h' <<'END_OF_FILE'
X/* bidding.h */
X/*
X			Bridge Bidder	Version 2.0
X			by Nathan Glasser
X			nathan@brokaw.lcs.mit.edu (internet)
X			nathan@mit-eddie.uucp (usenet)
X
X			February, 1989
X------------------------------------------------------------------------------
XCopyright 1988, 1989 by Nathan Glasser.
XYou may feel free to distribute this program in its current form.
XPlease do not remove this copyright information.
X*/
X
X#include <stdio.h>
X#include <ctype.h>
X#ifdef MSDOS
X#include <string.h>
X#include <stdlib.h>
X#define random rand
X#define srandom srand
X#define index strchr
X#else
X#include <strings.h>
X#endif
X
X#define LOGFILE "bidding.log"
X
X#define JACK 11
X#define QUEEN 12
X#define KING 13
X#define ACE 14
X
X#define SPADES 0
X#define HEARTS 1
X#define DIAMONDS 2
X#define CLUBS 3
X
X#define NOTRUMP 4
X#define RANK_USED 4
X
X#define DOUBLE 5
X#define REDOUBLE 6
X#define PASS 7
X
X
X#define FIRSTPAIR 0
X#define SECONDPAIR 1
X#define RELATIVE 1
X#define NEITHER 2
X#define BOTH 3
X
X
Xstruct card_or_bid {
X    int rank;
X    int suit;
X};
X
Xtypedef struct card_or_bid card;
X
Xtypedef struct bid {
X    struct card_or_bid bid;
X    struct bid *next,*prev;
X} bid;
X
Xtypedef card hand[13];
X
Xtypedef struct deal {
X    hand hands[4];
X    int vulnerability;
X    bid *bids;
X    int num_bids;
X    int bidding_done;
X    card opening_lead;
X} deal;
X
X
X
X/* Individual users may want to modify these values for their system. */
X
X/* Default number of bridge hands (boards) to deal. */
X#define DEF_NUM_HANDS 10
X
X/* If you wish to use formfeeds to clear the screen instead of repeated
X   newlines, comment out the definition of SCREEN_CLEAR_SIZE. Otherwise
X   this value indicates the number of newlines to use for this purpose. */
X#define SCREEN_CLEAR_SIZE 24
END_OF_FILE
if test 1694 -ne `wc -c <'bidding_new/bidding.h'`; then
    echo shar: \"'bidding_new/bidding.h'\" unpacked with wrong size!
fi
# end of 'bidding_new/bidding.h'
fi
if test -f 'bidding_new/deal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/deal.c'\"
else
echo shar: Extracting \"'bidding_new/deal.c'\" \(2251 characters\)
sed "s/^X//" >'bidding_new/deal.c' <<'END_OF_FILE'
X/* deal.c */
X/*
X			Bridge Bidder	Version 2.0
X			by Nathan Glasser
X			nathan@brokaw.lcs.mit.edu (internet)
X			nathan@mit-eddie.uucp (usenet)
X
X			February, 1989
X------------------------------------------------------------------------------
XCopyright 1988, 1989 by Nathan Glasser.
XYou may feel free to distribute this program in its current form.
XPlease do not remove this copyright information.
X*/
X
X#include "bidding.h"
X
X
Xcard_compare(pcard1,pcard2)
Xcard *pcard1,*pcard2;
X{
X    return((pcard1->suit != pcard2->suit) ? (pcard1->suit - pcard2->suit) :
X	   (pcard2->rank - pcard1->rank));
X}
X
Xdeal_hands(pdeal)
Xdeal *pdeal;
X{
X    card *thehand;
X    int cards[52];
X    int player,cardsinhand;
X    int cardnum;
X    int nextcard;
X    int cardsleft = 52;
X    static vulnerability = 0;
X
X    pdeal->num_bids = 0;
X    pdeal->bidding_done = 0;
X    vulnerability = ((pdeal->vulnerability = vulnerability) + 1) % 4;
X    pdeal->opening_lead.rank = pdeal->opening_lead.suit = -1;
X
X    for (cardnum = 0; cardnum < 52; cardnum++)
X	cards[cardnum] = 0;
X
X    for (player = 0; player < 4; player++)
X    {
X	thehand = pdeal->hands[player];
X	for (cardsinhand = 0; cardsinhand < 13; cardsinhand++)
X	{
X	    nextcard = random() % (cardsleft--);
X	    for (cardnum = 0 ; cards[cardnum] || --nextcard >= 0; cardnum++);
X	    cards[cardnum] = 1;
X	    thehand[cardsinhand].suit = cardnum / 13;
X	    thehand[cardsinhand].rank = 2 + (cardnum % 13);
X	}
X	qsort(thehand,13,sizeof(card),card_compare);
X    }
X}
X
X
Xprint_hand(fp,thehand)
XFILE *fp;
Xcard *thehand;
X{
X    int i;
X    char bufs[4][80];
X
X    format_hand(bufs,thehand);
X    for (i = 0; i < 4; i++)
X    {
X    	fputs(bufs[i],fp);
X	putc('\n',fp);
X    }
X}
X
X/* Accepts an array of size four of strings, and formats into it */
Xformat_hand(bufs,thehand)
Xchar (*bufs)[80];
Xcard *thehand;
X{
X    extern char *suit_strings[];
X    static char card_chars[] = "xx23456789TJQKA";
X    int suit_num = -1;
X    int i;
X    static char card_str[3] = " A";
X
X    bufs--;
X    for (i = 0; i < 13; i++)
X    {
X	while (thehand[i].suit != suit_num)
X	    sprintf(*++bufs,"%8s:  ",suit_strings[++suit_num]);
X	card_str[1] = card_chars[thehand[i].rank];
X	strcat(*bufs,card_str);
X    }
X    while (suit_num < 3)
X    	sprintf(*++bufs,"%8s:  ",suit_strings[++suit_num]);
X}
END_OF_FILE
if test 2251 -ne `wc -c <'bidding_new/deal.c'`; then
    echo shar: \"'bidding_new/deal.c'\" unpacked with wrong size!
fi
# end of 'bidding_new/deal.c'
fi
if test -f 'bidding_new/makefile.dos' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/makefile.dos'\"
else
echo shar: Extracting \"'bidding_new/makefile.dos'\" \(525 characters\)
sed "s/^X//" >'bidding_new/makefile.dos' <<'END_OF_FILE'
X# Makefile (ibm-pc/ms-dos) for
X#			Bridge Bidder	Version 2.0
X#			by Nathan Glasser
X#			nathan@brokaw.lcs.mit.edu (internet)
X#			nathan@mit-eddie.uucp (usenet)
X#
X#			February, 1989
X#-----------------------------------------------------------------------------
X#Copyright 1988, 1989 by Nathan Glasser.
X#You may feel free to distribute this program in its current form.
X#Please do not remove this copyright information.
X
XOBJS = bidding.obj deal.obj
X
Xbidding.exe:	$(OBJS)
X	link $(OBJS),bidding /stack:0x1000;
X
X$(OBJS):	bidding.h
END_OF_FILE
if test 525 -ne `wc -c <'bidding_new/makefile.dos'`; then
    echo shar: \"'bidding_new/makefile.dos'\" unpacked with wrong size!
fi
# end of 'bidding_new/makefile.dos'
fi
if test -f 'bidding_new/makefile.unx' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/makefile.unx'\"
else
echo shar: Extracting \"'bidding_new/makefile.unx'\" \(497 characters\)
sed "s/^X//" >'bidding_new/makefile.unx' <<'END_OF_FILE'
X# Makefile (unix) for
X#			Bridge Bidder	Version 2.0
X#			by Nathan Glasser
X#			nathan@brokaw.lcs.mit.edu (internet)
X#			nathan@mit-eddie.uucp (usenet)
X#
X#			February, 1989
X#-----------------------------------------------------------------------------
X#Copyright 1988, 1989 by Nathan Glasser.
X#You may feel free to distribute this program in its current form.
X#Please do not remove this copyright information.
X
XOBJS = bidding.o deal.o
X
Xbidding:	$(OBJS)
X	$(CC) $(OBJS) -o bidding
X
X$(OBJS):	bidding.h
END_OF_FILE
if test 497 -ne `wc -c <'bidding_new/makefile.unx'`; then
    echo shar: \"'bidding_new/makefile.unx'\" unpacked with wrong size!
fi
# end of 'bidding_new/makefile.unx'
fi
if test -f 'bidding_new/readme.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bidding_new/readme.doc'\"
else
echo shar: Extracting \"'bidding_new/readme.doc'\" \(865 characters\)
sed "s/^X//" >'bidding_new/readme.doc' <<'END_OF_FILE'
Xreadme.doc file for		Bridge Bidder	Version 2.0		2/89
X==============================================================================
XFiles included:
Xbidding.c		source
Xdeal.c			source
Xbidding.h		source
Xbidding.doc		documentation
Xreadme.doc		this file
Xmakefile.unx		makefile (unix)
Xmakefile.dos		makefile (ibm-pc/ms-dos)
X
X
XCompiling information
X==============================================================================
XThere are some #define's in bidding.h which can be adjusted to suit your
Xdesires. All of these appear at the very end of bidding.h.
X
XIn most cases, no adjustments will be necessary. Simply make sure the
Xappropriate makefile is set up for your system, and run make.
X
X
XDifferences between version 2.0 and 1.0
X========================================
XBetter display of current bidding sequence.
XCompile-time options for screen clearing installed.
END_OF_FILE
if test 865 -ne `wc -c <'bidding_new/readme.doc'`; then
    echo shar: \"'bidding_new/readme.doc'\" unpacked with wrong size!
fi
# end of 'bidding_new/readme.doc'
fi
echo shar: End of shell archive.
exit 0