[comp.sources.games] v11i038: vcraps - display-oriented craps game, Patch3

billr@saab.CNA.TEK.COM (Bill Randle) (08/28/90)

Submitted-by: Robert Steven Glickstein <bobg+@andrew.cmu.edu>
Posting-number: Volume 11, Issue 38
Archive-name: vcraps/Patch3
Patch-To: vcraps: Volume 11, Issue 34-35

[[This patch allows the '$' command to report how much of your money on
the table is in returnable bets (i.e., bets that can be taken down). 
The '$' command also retains the old behavior of reporting the total
amount of your current wagers.]]

#! /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:  patches03
# Wrapped by billr@saab on Mon Aug 27 10:02:00 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches03' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches03'\"
else
echo shar: Extracting \"'patches03'\" \(1452 characters\)
sed "s/^X//" >'patches03' <<'END_OF_FILE'
X*** patchlevel.h.orig	Fri Aug 24 12:09:14 1990
X--- patchlevel.h	Mon Aug 27 08:35:55 1990
X***************
X*** 1 ****
X! #define PATCHLEVEL	2
X--- 1 ----
X! #define PATCHLEVEL	3
X*** vcraps.c.orig	Fri Aug 24 12:08:43 1990
X--- vcraps.c	Mon Aug 27 08:35:27 1990
X***************
X*** 1755,1765 ****
X  
X  ShowTotal()
X  {
X!     int             i, total = 0;
X      char            buf[80];
X  
X!     for (i = craps_PassLine; i < craps_Bets; ++i)
X  	total += Craps_GetBet(&Table, i);
X!     sprintf(buf, "Wagers on table total $%d", total);
X      Message(buf);
X  }
X--- 1755,1790 ----
X  
X  ShowTotal()
X  {
X!     int             i, total = 0, returnable = 0;
X      char            buf[80];
X  
X!     for (i = craps_PassLine; i < craps_Bets; ++i) {
X  	total += Craps_GetBet(&Table, i);
X! 	switch (i) {
X! 	  case craps_PassLine:
X! 	  case craps_DontPass:
X! 	    if (Craps_Point(&Table) == 0)
X! 	      returnable += Craps_GetBet(&Table, i);
X! 	    break;
X! 	  case craps_Come4:
X! 	  case craps_Come5:
X! 	  case craps_Come6:
X! 	  case craps_Come8:
X! 	  case craps_Come9:
X! 	  case craps_Come10:
X! 	  case craps_DontCome4:
X! 	  case craps_DontCome5:
X! 	  case craps_DontCome6:
X! 	  case craps_DontCome8:
X! 	  case craps_DontCome9:
X! 	  case craps_DontCome10:
X! 	    break;
X! 	  default:
X! 	    returnable += Craps_GetBet(&Table, i);
X! 	    break;
X! 	}
X!     }
X!     sprintf(buf, "Wagers on table total $%d ($%d returnable)",
X! 	    total, returnable);
X      Message(buf);
X  }
END_OF_FILE
if test 1452 -ne `wc -c <'patches03'`; then
    echo shar: \"'patches03'\" unpacked with wrong size!
fi
# end of 'patches03'
fi
echo shar: End of shell archive.
exit 0