[comp.sources.games] v07i041: poker - five card draw poker, Patch1

billr@saab.CNA.TEK.COM (Bill Randle) (07/19/89)

Submitted-by: Metal Head <csx43%seq1.keele.ac.uk@nsfnet-relay.ac.uk>
Posting-number: Volume 7, Issue 41
Archive-name: poker/Patch1
Patch-To: poker: Volume 7, Issue 18

[I've actually wrapped two patches into one.  The major part is a
 new release from the original author with added comments.  The
 second part is a set of #ifdefs to get the game to work properly
 under HP-UX (series 300) - which should make it closer to working
 properly under Sys V.  -br]


#! /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:  patches01
# Wrapped by billr@saab on Wed Jul 19 07:02:54 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches01' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches01'\"
else
echo shar: Extracting \"'patches01'\" \(32896 characters\)
sed "s/^X//" >'patches01' <<'END_OF_FILE'
X*** README.orig	Thu Jul 13 09:05:00 1989
X--- README	Wed Jul 19 07:01:01 1989
X***************
X*** 1,20 ****
X-   	This vesion of poker was written under early BSD 4.2 (DYNIX),
X-     with a UCB universe.
X- 	It is not guaranteed to work when compiled in the att universe 
X-     (System V release 2) due to differences in curses.
X  
X  	The file poker.h should be edited to define how the instructions
X      are to be displayed. /usr/ucb/more is used, but this can be altered,
X      and so must the path to the file poker_rules.
X  	
X! 	The title screen (with the implementors address) is displayed
X!     by the procedure title(), which is in p_scr.c
X  
X! 	Most bugs have been removed, any that exist are in the hand
X!     recognition routines, and do not appear often. Anything that looks 
X!     suspicious is probably just a design feature that you do not agree 
X!     with, or is due to the compiler and universe used.
X  
X! 	I make this statement because I will soon loose my account, and
X!     will not be able to help with queries. The code is however, fairly
X!     well structured, so it should not be too hard to modify.
X--- 1,54 ----
X  
X+     Systems
X+     -------
X+ 
X+ 	This game of poker, successfully compiles and works under the
X+     following three systems :
X+ 
X+ 	DYNIX 3.0.15 , this is early BSD4.2, with some BSD4.3 enhancements
X+ 		       running on a sequent machine.
X+ 
X+ 	and
X+ 
X+ 	Ultrix-32 V2.2 , on MicroVax.
X+ 
X+ 	and
X+ 
X+ 	HP-UX series 300 (with HPUXs300 #defined, courtesy of Erk
X+ 			  van Bronkhorst)
X+ 
X+     There are, unfortunately, problems resulting from the use of curses, 
X+     that prevent it working under att SYSV, at the moment.
X+ 
X+     Implementor Notes
X+     -----------------
X+ 
X  	The file poker.h should be edited to define how the instructions
X      are to be displayed. /usr/ucb/more is used, but this can be altered,
X      and so must the path to the file poker_rules.
X+ 
X+ 	Poker.h also defines the speed of play, i.e. how long messages
X+     remain on the screen. There was a noticable difference between the
X+     speeds of the machines it was tested on.
X  	
X! 	Finally, the implementor's address should also be altered within
X!     poker.h
X! 	
X! 	After makeing these alterations, simply type
X  
X! 	      make poker
X  
X!     Improving Play
X!     --------------
X! 
X! 	It is possible to improve the game's playing ability, by
X!      modifying the 'percent' array in p_decide.c.
X! 	
X! 	This array contains 18 values, one for each of 18 distinct
X!      situations that require decisions based on probabilities. The
X!      values are the probabilities that an action (Drop,Call,Stay) will
X!      chosen.
X!        
X! 	The present values are very effective, having been tested against
X!      other versions of this game, but there is possibly room for improvement.
X! 
X*** makefile.orig	Wed Jul 19 06:53:30 1989
X--- makefile	Wed Jul 19 06:57:52 1989
X***************
X*** 1,8 ****
X! poker:	poker.o  p_scr.o  p_deal.o  p_hand.o p_strat.o p_decide.o input.o
X! 	cc -o poker p_scr.o poker.o p_deal.o  p_hand.o p_strat.o p_decide.o input.o -lcurses -ltermcap
X  # 
X! # remove the -ltermcap from the above line, to compile in System V version 2
X  #
X  
X  poker.o:	poker.c poker.h
X  
X--- 1,17 ----
X! # Makefile for poker
X! #
X! # Define HPUXs300 if you are running that OS
X! #
X! CFLAGS = # -DHPUXs300
X  # 
X! # remove the -ltermcap from the line below, to compile in
X! # System V version 2
X  #
X+ LIBS = -lcurses -ltermcap
X+ OBJS = poker.o p_scr.o p_deal.o p_hand.o p_strat.o p_decide.o input.o
X+ 
X+ poker:	$(OBJS)
X+ 	cc -o poker $(OBJS) $(LIBS)
X  
X  poker.o:	poker.c poker.h
X  
X*** input.c.orig	Thu Jul 13 08:54:11 1989
X--- input.c	Wed Jul 19 06:38:22 1989
X***************
X*** 1,22 ****
X  #include "poker.h"
X  
X  
X- 
X  void  get_input(des,val)
X        int des;
X        char *val;
X  
X! {/*  get a byte from the input descriptor */
X  
X     do
X     {
X!      while(read(des,val,1) != 1);
X!      if(*val == '\012')
X  	 redraw_screen();
X!      if(*val == 'F')  /*  quitting  */
X  	 really();
X      }
X!     while (*val == '\012' );
X  
X  }/* get i/p  */
X  
X--- 1,30 ----
X+ /*--------------------------------------------*\
X+ |   These procedures handle the majority of    |
X+ |  input from the user.                        |
X+ \*--------------------------------------------*/
X  #include "poker.h"
X  
X  
X  void  get_input(des,val)
X        int des;
X        char *val;
X  
X! /*---------------------------------------------*\
X! |    get a byte from the input descriptor       |
X! \*---------------------------------------------*/
X! {
X  
X     do
X     {
X!      while(read(des,val,1) != 1);      /* Wait for a key press */
X! 
X!      if(*val == '\022')
X  	 redraw_screen();
X! 
X!      if(*val == 'F')                   /*  quitting  */
X  	 really();
X      }
X!     while (*val == '\022' );
X  
X  }/* get i/p  */
X  
X***************
X*** 26,31 ****
X--- 34,42 ----
X        int   source;
X        char  *choice;
X  
X+ /*-----------------------------------------------*\
X+ |  Get a choice of Stay, Drop or Bet from user    |
X+ \*-----------------------------------------------*/
X  {
X     do
X        get_input(source,choice);
X***************
X*** 43,48 ****
X--- 54,62 ----
X        char  *choice;
X        int   turn;
X  
X+ /*-----------------------------------------------*\
X+ |  Get a choice of Raise, Drop or Call from user  |
X+ \*-----------------------------------------------*/
X  {
X     do
X        get_input(source,choice);
X***************
X*** 58,64 ****
X        int  source;
X        int  *amount;
X  
X! /* This gets the bet value, as multiples of 5 units */
X  {
X     char amt;
X  
X--- 72,81 ----
X        int  source;
X        int  *amount;
X  
X! /*--------------------------------------------------*\
X! |  Get the user's bet, or raise from a single key    |
X! | press, using multiles of five, for the bets.       |
X! \*--------------------------------------------------*/
X  {
X     char amt;
X  
X***************
X*** 66,72 ****
X       get_input(source,&amt);
X     while (amt < '1' || amt > '5');
X  
X!    *amount = ((amt - '0') * 5);
X  
X  }
X  
X--- 83,89 ----
X       get_input(source,&amt);
X     while (amt < '1' || amt > '5');
X  
X!    *amount = ((int)(amt - '0' ) * 5);
X  
X  }
X  
X***************
X*** 77,83 ****
X         int    *reject;
X         int    *exchange;
X  
X! /* Get the cards to be rejected by the user */
X  
X  {
X         int  no_of_cards,complete,count,ok,value;
X--- 94,103 ----
X         int    *reject;
X         int    *exchange;
X  
X! /*--------------------------------------------------*\
X! |   Get a maximum of Three cards to be rejected by   |
X! |  the user.                                         |
X! \*--------------------------------------------------*/
X  
X  {
X         int  no_of_cards,complete,count,ok,value;
X*** p_deal.c.orig	Thu Jul 13 08:54:11 1989
X--- p_deal.c	Thu Jul 13 08:58:43 1989
X***************
X*** 1,11 ****
X  #include "poker.h"
X  
X  static playing_card  standard[DECK_SIZE];
X! /* a template of the unshuffled pack */
X  
X  static playing_card  deck[DECK_SIZE];
X  static int  top_of_pack;
X! /* These are for the pack used to deal from */
X  
X  
X  long rand();
X--- 1,15 ----
X+ /*-------------------------------------------*\
X+ |  procedures to deal the cards               |
X+ \*-------------------------------------------*/
X+ 
X  #include "poker.h"
X  
X  static playing_card  standard[DECK_SIZE];
X!                      /* a template of the unshuffled pack */
X  
X  static playing_card  deck[DECK_SIZE];
X  static int  top_of_pack;
X!                      /* These are for the pack used to deal from */
X  
X  
X  long rand();
X*** p_decide.c.orig	Thu Jul 13 08:54:11 1989
X--- p_decide.c	Thu Jul 13 08:58:45 1989
X***************
X*** 1,12 ****
X  #include "poker.h" 
X  
X  long rand();
X  
X! static int percent[18] = {92,92,92,100,70,67,80,90,88,97,
X! 			  50,85,85,50,85,90,85,70};
X  
X! /*   Percent  is an array of percentages, used in the decision making */
X! /*  routine */
X  
X  
X  
X--- 1,26 ----
X+ /*----------------------------------------------------*\
X+ |   These procedures make all the strategy decisions.  |
X+ \*----------------------------------------------------*/
X+ 
X  #include "poker.h" 
X  
X  long rand();
X  
X! /*--------------------------------------------------*\
X! |   This next array determines the strategy, and     |
X! |  ability of the game.                              |
X! |   The values are probabilities relating to the     |
X! |  different decisions the game makes.               |
X! |   The first 5 values, relate to how often a Call   |
X! |  is made.                                          |
X! |   The next 10 affect the how often the machine     |
X! |  drops its cards.                                  |
X! |   The remainder are concerned with Calling.        |
X! \*--------------------------------------------------*/
X  
X! static int percent[18] = {92,92,92,100,70,                   /*  STAY  */
X! 			  67,80,90,88,97,50,85,85,50,85,     /*  DROP  */
X! 			  90,85,70};                         /*  CALL  */
X  
X  
X  
X***************
X*** 74,90 ****
X       int  Hv,last_act,deal,winnings;
X  
X  {
X!   /*******************************************************/
X!   /*   Do I stay ?                                       */
X!   /*                               			 */
X!   /* Only if Hv (Handvalue) == 0 and 			 */
X!   /*if last_act == 1 or 0 (i.e last was a stay, or 	 */
X!   /*you go first). 					 */
X!   /*                               			 */
X!   /* Which deal also determines staying, as on first deal*/
X!   /*there is room for improvement			 */
X!   /*                               			 */
X!   /*******************************************************/
X  
X  
X     int result;
X--- 88,104 ----
X       int  Hv,last_act,deal,winnings;
X  
X  {
X!   /*******************************************************\
X!   |*   Do I stay ?                                       *|
X!   |*                               			 *|
X!   |* Only if Hv (Handvalue) == 0 and 			 *|
X!   |*if last_act == 1 or 0 (i.e last was a stay, or 	 *|
X!   |*you go first). 					 *|
X!   |*                               			 *|
X!   |* Which deal also determines staying, as on first deal*|
X!   |*there is room for improvement			 *|
X!   |*                               			 *|
X!   \*******************************************************/
X  
X  
X     int result;
X***************
X*** 141,159 ****
X       int  winnings,turn;
X  
X  {
X!   /**********************************************/
X!   /*  Do i drop my cards ?			*/
X!   /*						*/
X!   /*  Only consider if nothing in hand and last */
X!   /*action was increase. Number of cards taken  */
X!   /*by opponent, if second deal, is important.	*/
X!   /* If presently losing money, then be more	*/
X!   /*cautious, and drop more often.		*/
X!   /*						*/
X!   /*   Follow through with a bluff, so never    */
X!   /* drop if have previously bet. 		*/
X!   /*						*/
X!   /**********************************************/
X  
X    int  result;
X  
X--- 155,173 ----
X       int  winnings,turn;
X  
X  {
X!   /**********************************************\
X!   |*  Do i drop my cards ?			*|
X!   |*						*|
X!   |*  Only consider if nothing in hand and last *|
X!   |*action was increase. Number of cards taken  *|
X!   |*by opponent, if second deal, is important.	*|
X!   |* If presently losing money, then be more	*|
X!   |*cautious, and drop more often.		*|
X!   |*						*|
X!   |*   Follow through with a bluff, so never    *|
X!   |* drop if have previously bet. 		*|
X!   |*						*|
X!   \**********************************************/
X  
X    int  result;
X  
X***************
X*** 226,234 ****
X       int Hv,turn,cards_taken,first_deal;
X  
X  {
X!    /* calling is determined by hand value and pot */
X!    /* on turn 6 of the betting the only options will be */
X!    /* drop or call, so automatically call on 6 */
X  
X     int action;
X  
X--- 240,250 ----
X       int Hv,turn,cards_taken,first_deal;
X  
X  {
X!    /*****************************************************\
X!    |* calling is determined by hand value and pot       *|
X!    |* on turn 6 of the betting the only options will be *|
X!    |* drop or call, so automatically call on 6          *|
X!    \*****************************************************/
X  
X     int action;
X  
X***************
X*** 262,276 ****
X        int Hv,first_deal,cards_taken;
X  
X  
X! {   /*  increase current bet by one of three amounts  */
X!     /*   Small , Medium , Large .                     */
X!     /*						      */
X!     /*  returned amounts are :-			      */
X!     /*						      */
X!     /*   1 - 5 , corresponding to bets of             */
X!     /*   5,10,15,20,25  respectively		      */
X!     /*						      */
X  
X      int  amount;
X  
X  
X--- 278,295 ----
X        int Hv,first_deal,cards_taken;
X  
X  
X!     /**************************************************\
X!     |*  increase current bet by one of three amounts  *|
X!     |*   Small , Medium , Large .                     *|
X!     |*						      *|
X!     |*  returned amounts are :-			      *|
X!     |*						      *|
X!     |*   1 - 5 , corresponding to bets of             *|
X!     |*   5,10,15,20,25  respectively		      *|
X!     |*						      *|
X!     \**************************************************/
X  
X+ {
X      int  amount;
X  
X  
X*** p_hand.c.orig	Thu Jul 13 08:54:11 1989
X--- p_hand.c	Thu Jul 13 08:58:46 1989
X***************
X*** 1,13 ****
X  #include "poker.h"
X  
X- /*  p_hand.c  what is in the hand  */
X  
X  
X- 
X  flush  flusher(hand)
X        playing_card *hand;
X  
X! /* Identify the xistence of a (partial)flush, and record the cards involved */
X  {
X     flush  result;
X  
X--- 1,18 ----
X+ /*--------------------------------------------------*\
X+ |   These procedures determine what is in the hand,  |
X+ |  or could be made out of the hand.                 |
X+ \*--------------------------------------------------*/
X  #include "poker.h"
X  
X  
X  
X  flush  flusher(hand)
X        playing_card *hand;
X  
X! /*------------------------------------------------*\
X! |     Identify the existence of a (partial)flush,  |
X! |   and record the cards involved.                 |
X! \*------------------------------------------------*/
X  {
X     flush  result;
X  
X***************
X*** 14,20 ****
X     int count1,count2,x_posn;
X     int suit_matrix[4][HAND_SIZE + 1];
X  
X! /* suit_matrix holds the no. of cards in each suit */
X  
X     result.flush_of = 0;
X  
X--- 19,25 ----
X     int count1,count2,x_posn;
X     int suit_matrix[4][HAND_SIZE + 1];
X  
X! /*| suit_matrix holds the no. of cards in each suit |*/
X  
X     result.flush_of = 0;
X  
X***************
X*** 48,57 ****
X  }/* flusher */
X  
X  
X  int  high_straight(hand)
X       playing_card  *hand;
X  
X! /* Identify the existence of a five card straight */
X  {
X  
X      int have,ace;
X--- 53,65 ----
X  }/* flusher */
X  
X  
X+ 
X  int  high_straight(hand)
X       playing_card  *hand;
X  
X! /*------------------------------------------------*\
X! |* Identify the existence of a five card straight *|
X! \*------------------------------------------------*/
X  {
X  
X      int have,ace;
X***************
X*** 85,91 ****
X  prile  pairs(hand)
X        playing_card  *hand;
X  
X! /* find any pairs, or groupings of pairs */
X  {
X     int count,card_count,res,card;
X     int check[13];
X--- 93,101 ----
X  prile  pairs(hand)
X        playing_card  *hand;
X  
X! /*---------------------------------------*\
X! |* find any pairs, or groupings of pairs *|
X! \*---------------------------------------*/
X  {
X     int count,card_count,res,card;
X     int check[13];
X***************
X*** 132,141 ****
X       int  pair;
X       int  posn;
X  
X! /* Identify any partial runs, of length >= 3 */
X! /* It uses a sliding window, of varying size, to isolate */
X! /* any runs, then does specific checks at the end for open */
X! /* runs, such as 34_67 */
X  
X  {
X     playing_card  hand[HAND_SIZE];
X--- 142,153 ----
X       int  pair;
X       int  posn;
X  
X! /*----------------------------------------------------------*\
X! |  Identify any partial runs, of length >= 3                 |
X! |  It uses a sliding window, of varying size, to isolate     |
X! |  any runs, then does specific checks at the end for open   |
X! |  runs, such as 34_67                                       |
X! \*----------------------------------------------------------*/
X  
X  {
X     playing_card  hand[HAND_SIZE];
X***************
X*** 149,157 ****
X  
X  
X     for(count=0;count<HAND_SIZE;count++)
X-      /*  move in_hand to hand */
X-      /* so as not to corrupt hand */
X  
X  	 hand[count] = in_hand[count];
X  
X  	
X--- 161,170 ----
X  
X  
X     for(count=0;count<HAND_SIZE;count++)
X  
X+      /*  move in_hand to hand making a copy */
X+      /* so as not to corrupt hand           */
X+ 
X  	 hand[count] = in_hand[count];
X  
X  	
X***************
X*** 162,176 ****
X     result.open_str = 0;
X     begin = 0;
X  
X!    if (pair)  /* if a pair is present */
X       {
X!        if(posn == 0)  /* check if card is first in hand */
X! 		      /* then find a card to compare suits with */
X  	   compare = 2;
X  	else
X  	   compare = posn - 1;
X         
X!        /* preserve any straight flushes */
X  
X         if(hand[posn].suit == hand[compare].suit)
X  	    remove = posn + 1;
X--- 175,189 ----
X     result.open_str = 0;
X     begin = 0;
X  
X!    if (pair)                                    /* if a pair is present */
X       {
X!        if(posn == 0)           /* check if card is first in hand */
X! 		               /* then find a card to compare suits with */
X  	   compare = 2;
X  	else
X  	   compare = posn - 1;
X         
X!                                        /* preserve any straight flushes */
X  
X         if(hand[posn].suit == hand[compare].suit)
X  	    remove = posn + 1;
X***************
X*** 177,183 ****
X  	else
X  	    remove = posn;
X         
X!        /* shift chosen card to right of hand */
X  
X         for(count=remove+1;count < HAND_SIZE;count++)
X  	   swap((hand + count -1),(hand+count));
X--- 190,196 ----
X  	else
X  	    remove = posn;
X         
X!                                   /* shift chosen card to right of hand */
X  
X         for(count=remove+1;count < HAND_SIZE;count++)
X  	   swap((hand + count -1),(hand+count));
X***************
X*** 184,190 ****
X       }
X     
X     limit = HAND_SIZE - pair;  /* 4 or 5 */
X!    /* limit is the number of cards, in the possibly altered hand */
X  
X     do
X     {
X--- 197,203 ----
X       }
X     
X     limit = HAND_SIZE - pair;  /* 4 or 5 */
X!           /* limit is the number of cards, in the possibly altered hand */
X  
X     do
X     {
X***************
X*** 221,231 ****
X  	   result.card[count] = begin + count;
X  
X  
X!     if(result.length == 3) /* look for open straight */
X        {
X  	if (begin > 0)
X  	     {
X! 	     /* check card to left */
X  
X  	     if(hand[(begin - 1)].face_value == hand[begin].face_value - 2)
X  	       {
X--- 234,244 ----
X  	   result.card[count] = begin + count;
X  
X  
X!     if(result.length == 3)                       /* look for open straight */
X        {
X  	if (begin > 0)
X  	     {
X! 	                                          /* check card to left */
X  
X  	     if(hand[(begin - 1)].face_value == hand[begin].face_value - 2)
X  	       {
X***************
X*** 233,239 ****
X  		 result.open_str = 1;
X  	       }
X  	      if((begin + 2) < (limit - 1))
X! 	      /* check card to right if 3 run is in middle of hand */
X  
X  	        if(hand[limit].face_value == hand[limit - 1].face_value + 2)
X  	          {
X--- 246,252 ----
X  		 result.open_str = 1;
X  	       }
X  	      if((begin + 2) < (limit - 1))
X! 	              /* check card to right if 3 run is in middle of hand */
X  
X  	        if(hand[limit].face_value == hand[limit - 1].face_value + 2)
X  	          {
X***************
X*** 243,249 ****
X  
X               }
X  	  else
X! 	    /*  begin = 0 */
X  	     if (hand[3].face_value == hand[2].face_value + 2)
X  	       {
X  		 result.card[result.length++ ] = 3;
X--- 256,262 ----
X  
X               }
X  	  else
X! 	    /*  begin == 0 */
X  	     if (hand[3].face_value == hand[2].face_value + 2)
X  	       {
X  		 result.card[result.length++ ] = 3;
X***************
X*** 288,296 ****
X        }
X  
X     if(pair)
X!        /* undo shifting of cards */
X         /* by incrementing the positon of cards to the right of the */
X!        /* moved card */
X  
X         for(count=0;count<result.length;count++)
X  	   result.card[count] += (count >= remove);
X--- 301,309 ----
X        }
X  
X     if(pair)
X!        /* undo shifting of cards                                   */
X         /* by incrementing the positon of cards to the right of the */
X!        /* moved card                                               */
X  
X         for(count=0;count<result.length;count++)
X  	   result.card[count] += (count >= remove);
X***************
X*** 307,313 ****
X--- 320,328 ----
X  
X       playing_card *hand;
X  
X+ /***************************************/
X  /* find all the High cards, i.e. >= 10 */
X+ /***************************************/
X  
X  {
X      int   count;
X*** p_scr.c.orig	Thu Jul 13 08:54:11 1989
X--- p_scr.c	Wed Jul 19 06:51:30 1989
X***************
X*** 8,19 ****
X  #define MES_X 1
X  
X  
X  
X- /* These functions will handle the display */
X  
X- WINDOW  *_card[10];
X  
X! /* a window for each card */
X  
X  
X  really()
X--- 8,21 ----
X  #define MES_X 1
X  
X  
X+ /*-------------------------------------------------------*\
X+ |   These procedures handle the control of the screen     |
X+ |  using curses.                                          |
X+ \*-------------------------------------------------------*/
X  
X  
X  
X! WINDOW  *_card[10];              /* a seperate window for each card */
X  
X  
X  really()
X***************
X*** 46,55 ****
X  }
X  
X  
X  die ()
X! {  /* what to do if user interupts */
X     /* and really wants to quit     */
X  
X     signal(SIGINT,SIG_IGN);
X     echo();
X     nocrmode();
X--- 48,63 ----
X  }
X  
X  
X+ 
X  die ()
X!    /********************************/
X!    /* What to do if user interupts */
X     /* and really wants to quit     */
X+    /*  Or at end of game.          */
X+    /********************************/
X  
X+ {
X+ 
X     signal(SIGINT,SIG_IGN);
X     echo();
X     nocrmode();
X***************
X*** 65,77 ****
X  {
X     initscr();
X  
X!    /*  initscr() has problems when compiled under att SysV  */
X  
X     if (ERR)
X         {
X  	 printf("Error in initialising curses\n");
X  	 die();
X         }
X  
X     nl();
X     noecho();
X--- 73,87 ----
X  {
X     initscr();
X  
X!                /*  initscr() has problems when compiled under att SysV  */
X  
X+ #ifndef HPUXs300
X     if (ERR)
X         {
X  	 printf("Error in initialising curses\n");
X  	 die();
X         }
X+ #endif
X  
X     nl();
X     noecho();
X***************
X*** 80,86 ****
X     scrollok(stdscr,FALSE);
X     signal(SIGINT,really);
X     signal(SIGQUIT,really);
X!    /*  these signals have problems when compiled under att SysV  */
X  
X  }/* init */
X  
X--- 90,96 ----
X     scrollok(stdscr,FALSE);
X     signal(SIGINT,really);
X     signal(SIGQUIT,really);
X!             /*  these signals have problems when compiled under att SysV  */
X  
X  }/* init */
X  
X***************
X*** 92,106 ****
X  
X     clear();
X     move(10,0);
X!    printw("          +----------------------------------------------------+\n");
X!    printw("          |           Welcome to 5 Card Draw Poker             |\n");
X!    printw("          |                                                    |\n");
X!    printw("          | This is the Final Year Project of Nic Smith.       |\n");
X!    printw("          | Written for BSD 4.2 Unix                           |\n");
X!    printw("          | Please mail any comments or bugs to :-             |\n");
X!    printw("          |             csx43@uk.ac.kl.seq1                    |\n");
X!    printw("          +----------------------------------------------------+\n");
X  
X     move(22,0);
X     printw("---More---");
X     refresh();
X--- 102,118 ----
X  
X     clear();
X     move(10,0);
X!    printw("         +----------------------------------------------------+\n");
X!    printw("         |           Welcome to 5 Card Draw Poker             |\n");
X!    printw("         |                                                    |\n");
X!    printw("         | This is the Final Year Project of Nic Smith.       |\n");
X!    printw("         |             csx43@uk.ac.kl.seq1                    |\n");
X!    printw("         | The implementor of this version can be reached at :|\n");
X  
X+    printw(IMPLEMENTOR);  /* This is defined in poker.h  */
X+ 
X+    printw("         +----------------------------------------------------+\n");
X+ 
X     move(22,0);
X     printw("---More---");
X     refresh();
X***************
X*** 115,121 ****
X--- 127,139 ----
X  redraw_screen()
X  
X  {
X+ #ifdef HPUXs300
X+ int count;
X+    for (count=0;count<10;count++)  /* places for the two hands */
X+       wrefresh(_card[count]);
X+ #else
X     wrefresh(curscr);
X+ #endif
X  }
X  
X  
X***************
X*** 152,158 ****
X  
X  draw_screen()
X  
X!     /* set up the screen for the game. */
X  
X  {
X     int count;
X--- 170,180 ----
X  
X  draw_screen()
X  
X!     /*************************************************/
X!     /* Set up the screen for the game.               */
X!     /* i.e. Ten card windows, and positions for the  */
X!     /* pot and stakes.                               */
X!     /*************************************************/
X  
X  {
X     int count;
X***************
X*** 161,167 ****
X     clear();
X     refresh();
X  
X!    /* first, draw the ten windows for the cards  */
X  
X     for (count =0;count<10;count++)  /* places for the two hands */
X        {
X--- 183,189 ----
X     clear();
X     refresh();
X  
X!                       /* first, draw the ten windows for the cards  */
X  
X     for (count =0;count<10;count++)  /* places for the two hands */
X        {
X***************
X*** 171,186 ****
X  	box(_card[count],'|','-');
X  
X  	wmove(_card[count],0,0);
X! 	waddch(_card[count],'+');
X  
X  	wmove(_card[count],4,0);
X! 	waddch(_card[count],'+');
X  
X  	wmove(_card[count],0,4);
X! 	waddch(_card[count],'+');
X  
X  	wmove(_card[count],4,4);
X! 	waddch(_card[count],'+');
X        };
X  
X  /* Then number the cards */
X--- 193,208 ----
X  	box(_card[count],'|','-');
X  
X  	wmove(_card[count],0,0);
X! 	waddch(_card[count],'.');
X  
X  	wmove(_card[count],4,0);
X! 	waddch(_card[count],'\`');
X  
X  	wmove(_card[count],0,4);
X! 	waddch(_card[count],'.');
X  
X  	wmove(_card[count],4,4);
X! 	waddch(_card[count],'\'');
X        };
X  
X  /* Then number the cards */
X***************
X*** 194,199 ****
X--- 216,224 ----
X         printw("%d",count + 1);
X  
X         refresh();
X+ #ifdef HPUXs300
X+ 	redraw_screen();
X+ #endif
X     }
X  
X  
X***************
X*** 241,246 ****
X--- 266,275 ----
X  
X  	wmove(_card[WHERE(count,at_bottom)],3,3);
X  	waddch(_card[WHERE(count,at_bottom)],hand[count].suit);
X+ 
X+ #ifdef HPUXs300
X+         wrefresh(_card[WHERE(count,at_bottom)]);
X+ #endif
X         };
X     refresh();
X  
X***************
X*** 266,271 ****
X--- 295,303 ----
X  	wmove(_card[HAND_SIZE + count],3,3);
X  	waddch(_card[HAND_SIZE + count],' ');
X  
X+ #ifdef HPUXs300
X+         wrefresh(_card[HAND_SIZE + count]);
X+ #endif
X         };
X     refresh();
X  
X***************
X*** 299,305 ****
X  {
X      int pause;
X  
X!     for(pause=0;pause<900000;pause++);
X      move(13,0);
X      if(win == -1)
X        printw("It is a draw, the pot stays. ");
X--- 331,337 ----
X  {
X      int pause;
X  
X!     for(pause=0;pause<PAUSE_LEN;pause++);
X      move(13,0);
X      if(win == -1)
X        printw("It is a draw, the pot stays. ");
X***************
X*** 307,313 ****
X  	printw("%s win.                ",win?"I ":"You ");
X  
X      refresh();
X!     for(pause=0;pause<900000;pause++);
X  
X  }/* show_winner  */
X  
X--- 339,345 ----
X  	printw("%s win.                ",win?"I ":"You ");
X  
X      refresh();
X!     for(pause=0;pause<PAUSE_LEN;pause++);
X  
X  }/* show_winner  */
X  
X***************
X*** 340,346 ****
X  
X      refresh();
X  
X!     for(pause=0;pause<900000;pause++);
X  
X  }/* show_over_win */
X  
X--- 372,378 ----
X  
X      refresh();
X  
X!     for(pause=0;pause<PAUSE_LEN;pause++);
X  
X  }/* show_over_win */
X  
X***************
X*** 374,380 ****
X  
X     refresh();
X     if(what == 1)
X!       for(pause=0;pause<900000;pause++);
X  
X  }/* i_do */
X  
X--- 406,412 ----
X  
X     refresh();
X     if(what == 1)
X!       for(pause=0;pause<PAUSE_LEN;pause++);
X  
X  }/* i_do */
X  
X***************
X*** 512,517 ****
X--- 544,551 ----
X  
X  clear_mid()
X  
X+ /*  Clear the message lines at the middle of the screen  */
X+ 
X  {
X     move(9,0);
X     printw("                                            ");
X***************
X*** 539,545 ****
X      move (11,0);
X      printw("We ante%s.                        ",(pot > 10)?" again":"");
X      refresh();
X!     for(pause=0;pause < 900000;pause++);
X      clear_mid();
X  
X  }/* inform ante */
X--- 573,579 ----
X      move (11,0);
X      printw("We ante%s.                        ",(pot > 10)?" again":"");
X      refresh();
X!     for(pause=0;pause < PAUSE_LEN;pause++);
X      clear_mid();
X  
X  }/* inform ante */
X***************
X*** 569,575 ****
X  
X  delete_line()
X  
X! /*  delete the line of rejected cards  */
X  
X  {
X      move(9,35);
X--- 603,609 ----
X  
X  delete_line()
X  
X! /*  delete the user's input  */
X  
X  {
X      move(9,35);
X***************
X*** 595,600 ****
X--- 629,637 ----
X       across = 35 + (count * 2);
X  
X       mvaddch(9,across,choice);
X+ #ifdef HPUXs300
X+      wrefresh(9);
X+ #endif
X       refresh();
X  
X  }/* show choice */
X***************
X*** 613,619 ****
X      printw("I will take %d card%s                       ",num,
X  						   (num != 1)?"s.":".");
X      refresh();
X!     for(pause = 0;pause < 900000;pause++);
X      move(11,0);
X      printw("                                            ");
X      refresh();
X--- 650,656 ----
X      printw("I will take %d card%s                       ",num,
X  						   (num != 1)?"s.":".");
X      refresh();
X!     for(pause = 0;pause < PAUSE_LEN;pause++);
X      move(11,0);
X      printw("                                            ");
X      refresh();
X*** p_strat.c.orig	Thu Jul 13 08:54:11 1989
X--- p_strat.c	Thu Jul 13 08:58:49 1989
X***************
X*** 1,7 ****
X--- 1,11 ----
X+ 
X  #include "poker.h"
X  
X  /****************************************/
X  /*  p_strat.c  strategies               */
X+ /* Determine what is in the hand, and   */
X+ /* make the appropriate strategy        */
X+ /* decisions.                           */
X  /****************************************/
X  /* 					*/
X  /*  Hand value :-			*/
X***************
X*** 436,441 ****
X--- 440,446 ----
X  /* The hand evaluation routine */
X  
X  {
X+                       /* First find what is in the hand  */
X  
X    flushes = flusher(hand);
X  
X***************
X*** 444,451 ****
X    priles = pairs(hand);
X  
X    if(first_deal && !hi_straight) 
X! 		/* not needed second deal, as can not 	     */
X! 		/* improve any more or if hi straight found  */
X      if(priles.p_type <= 4)
X  
X         straight = runs(hand,(priles.p_type == 4),priles.cards[0]);
X--- 449,456 ----
X    priles = pairs(hand);
X  
X    if(first_deal && !hi_straight) 
X! 		              /* not needed second deal, as can not        */
X! 		              /* improve any more or if hi straight found  */
X      if(priles.p_type <= 4)
X  
X         straight = runs(hand,(priles.p_type == 4),priles.cards[0]);
X***************
X*** 466,472 ****
X--- 471,479 ----
X         handle_no_prile(hand,first_deal);
X  
X    if(!first_deal)  /* on 2nd deal all other Hv's are irrelevant */
X+ 
X        if(res.hand_value <13 && res.hand_value != 11 && res.hand_value !=8)
X+ 
X  	  res.hand_value = 0;
X  
X  
X*** poker.h.orig	Thu Jul 13 08:54:12 1989
X--- poker.h	Wed Jul 19 06:53:01 1989
X***************
X*** 1,9 ****
X! /*******************************************************/
X! /* This must be altered to the location of the rules  */
X! /* file, and the paging method used, e.g. more.	       */
X! /*******************************************************/
X  
X  #define INSTRUCTIONS "/usr/ucb/more /usr/games/lib/poker_rules"
X  
X  /*  Leave the rest  */
X  
X--- 1,30 ----
X! /*******************************************************\
X! |* This must be altered to the location of the rules   *|
X! |* file, and the paging method used, e.g. more.	       *|
X! \*******************************************************/
X  
X+ #ifdef HPUXs300
X+ #define INSTRUCTIONS "/usr/bin/more /usr/games/lib/poker_rules"
X+ #else
X  #define INSTRUCTIONS "/usr/ucb/more /usr/games/lib/poker_rules"
X+ #endif
X+ 
X+ /******************************************************\
X+ |*   This next will affect the length of time any     *|
X+ |*  message is displayed for, before being erase.     *|
X+ |*  It should be reduced to speed up the game, on     *|
X+ |*  slower machines.                                  *|
X+ \******************************************************/
X+ 
X+ #define PAUSE_LEN 900000
X+ 
X+ 
X+ /******************************************************\
X+ |*  The next definition is the implementor's mail     *|
X+ |* address, and is displayed on the title_screen.     *|
X+ \******************************************************/
X+ 
X+ #define IMPLEMENTOR "         |           csx43@uk.ac.kl.seq1                      |\n"
X  
X  /*  Leave the rest  */
X  
END_OF_FILE
if test 32896 -ne `wc -c <'patches01'`; then
    echo shar: \"'patches01'\" unpacked with wrong size!
fi
# end of 'patches01'
fi
echo shar: End of shell archive.
exit 0