[comp.sources.games] v09i044: othello2 - othello game for SunView/XView/X11/curses, Patch2

billr@saab.CNA.TEK.COM (Bill Randle) (05/03/90)

Submitted-by: Rich Burridge <rburridge@sun.COM>
Posting-number: Volume 9, Issue 44
Archive-name: othello2/Patch2
Patch-To: othello2: Volume 9, Issue 37-40

    [[This is official patch #2 for othello v1.3; please apply it.]]


#! /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:  patches02
# Wrapped by billr@saab on Wed May  2 13:32:22 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches02' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches02'\"
else
echo shar: Extracting \"'patches02'\" \(10028 characters\)
sed "s/^X//" >'patches02' <<'END_OF_FILE'
X
XThis is official patch #2 for othello v1.3; please apply it.
X
XIt makes the following changes.
X
X       * From D. Hugh Redelmeier <hugh@csri.toronto.edu>
X              keith%Stardent.COM@munnari.oz
X         "sprintf()" is varadic.  In ANSI, a varadic function may not be
X         declared with an old-style declaration.
X 
X       * From D. Hugh Redelmeier <hugh@csri.toronto.edu>
X         The external definition for gtype is no longer needed.
X 
X       * From keith%Stardent.COM@munnari.oz [fix]
X              Scott W. Danielson <sdaniels@NMSU.Edu>
X              Gary D. Kline <uunet!ssi!gdk@munnari.oz>
X              Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
X         The tty version code dumps after one move. A character array
X         declaration in handle_key in events.c was declared one character
X         to small. I suspect this one, will fix up a lot of random
X         problems.
X 
X       * From Peter Johansson <cs480125@umbc5.umbc.edu>
X         $(NO_USLEEP) must be added to CFLAGS in the Makefile.
X 
X       * From Peter Johansson <cs480125@umbc5.umbc.edu>
X         The axes labelling for the tty version is incorrect. This is
X         a problem that was introduced by patch #1.
X          
X       * From Peter Johansson <cs480125@umbc5.umbc.edu>
X         The moves generated by keyboard input are incorrect.
X          
X       * From Peter Johansson <cs480125@umbc5.umbc.edu>
X         It would be nice if (at least on the tty version) the text
X         "black" was replaced with "X" or "black (X)" and likewise for
X         white.
X
X
X------- extern.h -------
X*** /tmp/da01144	Tue May  1 11:02:35 1990
X--- extern.h	Fri Apr 27 13:55:39 1990
X***************
X*** 94,99 ****
X  extern BOARD moves[64] ;     /* Complete array of board moves. */
X  
X  extern enum cantype cmode ;
X- extern enum gr_type gtype ;  /* Indicates what graphics system is being used. */
X  extern enum playtype play_mode ;
X  extern enum set_type direction ;   /* Incremental direction for cycle item. */
X--- 94,98 ----
X
X------- othello.h -------
X*** /tmp/da01147	Tue May  1 11:02:36 1990
X--- othello.h	Tue May  1 10:54:35 1990
X***************
X*** 37,42 ****
X--- 37,43 ----
X  #define  SELECT        (void) select
X  #define  SIGNAL        (void) signal
X  #define  SPRINTF       (void) sprintf
X+ #define  SSCANF        (void) sscanf
X  #define  STRCAT        (void) strcat
X  #define  STRCPY        (void) strcpy
X  #define  WRITE         (void) write
X***************
X*** 153,159 ****
X  
X  enum playtype { PLAY_BLACK, PLAY_WHITE } ; /* What the computer is playing. */
X  
X! char *getenv(), *sprintf() ;
X  
X  typedef struct {
X            int square[64] ;
X--- 154,160 ----
X  
X  enum playtype { PLAY_BLACK, PLAY_WHITE } ; /* What the computer is playing. */
X  
X! char *getenv() ;
X  
X  typedef struct {
X            int square[64] ;
X
X------- patchlevel.h -------
X*** /tmp/da01150	Tue May  1 11:02:37 1990
X--- patchlevel.h	Fri Apr 27 13:51:09 1990
X***************
X*** 19,22 ****
X   *  to me, then an attempt will be made to fix them.
X   */
X  
X! #define  PATCHLEVEL  1
X--- 19,22 ----
X   *  to me, then an attempt will be made to fix them.
X   */
X  
X! #define  PATCHLEVEL  2
X
X------- README -------
X*** /tmp/da01153	Tue May  1 11:02:37 1990
X--- README	Tue May  1 10:27:38 1990
X***************
X*** 27,34 ****
X  code, and to Ed Falk for the initial SunView version.
X  
X  Thanks go also to Valerie Haecky, Daniel Yang, Eric R. Jorgensen,
X! John Rosauer, Steve Misrack, Hugues Leroy, Linton Miller and Mike
X! Stump for bug reports and/or bug fixes plus suggested enhancements.
X  
X  
X  Suggestions for furthur improvement would be most welcome, plus bugs,
X--- 27,36 ----
X  code, and to Ed Falk for the initial SunView version.
X  
X  Thanks go also to Valerie Haecky, Daniel Yang, Eric R. Jorgensen,
X! John Rosauer, Steve Misrack, Hugues Leroy, Linton Miller, Mike Stump,
X! D. Hugh Redelmeier, Scott W. Danielson, Gary D. Kline, Kjetil Torgrim
X! Homme and Peter Johansson for bug reports and/or bug fixes plus suggested
X! enhancements.
X  
X  
X  Suggestions for furthur improvement would be most welcome, plus bugs,
X
X------- Makefile -------
X*** /tmp/da01156	Tue May  1 11:02:38 1990
X--- Makefile	Tue May  1 10:56:36 1990
X***************
X*** 69,75 ****
X  #
X  #  Compilation flags and standard macro definitions.
X  #
X! CFLAGS          = -g $(REMNAME) $(SIGRET) $(X11INCDIR) $(XVIEWINCDIR)
X  #
X  #==========================================================================
X  
X--- 69,76 ----
X  #
X  #  Compilation flags and standard macro definitions.
X  #
X! CFLAGS          = -g $(NO_USLEEP) $(REMNAME) $(SIGRET) \
X! 		     $(X11INCDIR) $(XVIEWINCDIR)
X  #
X  #==========================================================================
X  
X
X------- CHANGES -------
X*** /tmp/da01159	Tue May  1 11:02:38 1990
X--- CHANGES	Tue May  1 10:57:23 1990
X***************
X*** 52,54 ****
X--- 52,88 ----
X         * From Hugues.Leroy%irisa.fr@munnari.oz
X           Some old machines with old compilers don't accept struct parameters.
X           Various functions have been adjusted to handle this.
X+ 
X+ v1.3 - patchlevel 2. 1st May 1990.
X+ 
X+        * From D. Hugh Redelmeier <hugh@csri.toronto.edu>
X+               keith%Stardent.COM@munnari.oz
X+          "sprintf()" is varadic.  In ANSI, a varadic function may not be
X+          declared with an old-style declaration.
X+ 
X+        * From D. Hugh Redelmeier <hugh@csri.toronto.edu>
X+          The external definition for gtype is no longer needed.
X+ 
X+        * From keith%Stardent.COM@munnari.oz [fix]
X+               Scott W. Danielson <sdaniels@NMSU.Edu>
X+               Gary D. Kline <uunet!ssi!gdk@munnari.oz>
X+               Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
X+          The tty version code dumps after one move. A character array
X+          declaration in handle_key in events.c was declared one character
X+          to small. I suspect this one, will fix up a lot of random
X+          problems.
X+ 
X+        * From Peter Johansson <cs480125@umbc5.umbc.edu>
X+          $(NO_USLEEP) must be added to CFLAGS in the Makefile.
X+ 
X+        * From Peter Johansson <cs480125@umbc5.umbc.edu>
X+          The axes labelling for the tty version is incorrect. This is
X+          a problem that was introduced by patch #1.
X+ 
X+        * From Peter Johansson <cs480125@umbc5.umbc.edu>
X+          The moves generated by keyboard input are incorrect.
X+ 
X+        * From Peter Johansson <cs480125@umbc5.umbc.edu>
X+          It would be nice if (at least on the tty version) the text
X+          "black" was replaced with "X" or "black (X)" and likewise for
X+          white.
X
X------- events.c -------
X*** /tmp/da01162	Tue May  1 11:02:39 1990
X--- events.c	Tue May  1 10:39:03 1990
X***************
X*** 201,207 ****
X  do_key_move(n1, n2)
X  int n1, n2 ;
X  {
X!   move = (n1 - 'a') * BOARD_SIZE + (n2 - '1') ;
X    next_player = (int) cmode - 1 ;
X    cmode = (enum cantype) ((int) cmode + 1) ;
X    make_move() ;
X--- 201,207 ----
X  do_key_move(n1, n2)
X  int n1, n2 ;
X  {
X!   move = (n2 - '1') * BOARD_SIZE + (n1 - 'a') ;
X    next_player = (int) cmode - 1 ;
X    cmode = (enum cantype) ((int) cmode + 1) ;
X    make_move() ;
X***************
X*** 271,277 ****
X  
X  handle_key()     /* Process the latest key that the user has pressed. */
X  {
X!   char str[8] ;  /* To display half move position. */
X    int nextc ;
X  
X    if (cur_ch == ESCAPE) validkey = 0 ;
X--- 271,277 ----
X  
X  handle_key()     /* Process the latest key that the user has pressed. */
X  {
X!   char str[9] ;  /* To display half move position. */
X    int nextc ;
X  
X    if (cur_ch == ESCAPE) validkey = 0 ;
X
X------- tty.c -------
X*** /tmp/da01165	Tue May  1 11:02:40 1990
X--- tty.c	Tue May  1 10:58:31 1990
X***************
X*** 120,137 ****
X      {
X        tputs(CL, 1, outc) ;
X        tc_move(4, 3) ;
X!       outstr("1   2   3   4   5   6   7   8") ;
X        for (y = 4; y < 21; y++)
X          {
X            tc_move(1, y) ;
X            if (y % 2)
X              SPRINTF(nextline, "%c|   |   |   |   |   |   |   |   |%c",
X!                               'a' + (y - 4) / 2, 'a' + (y - 4) / 2) ;
X            else       SPRINTF(nextline, " +---+---+---+---+---+---+---+---+") ;
X            outstr(nextline) ;
X          }
X        tc_move(4, 21) ;
X!       outstr("1   2   3   4   5   6   7   8") ;
X      }
X    else if (width == PSIZE && height == PSIZE)
X      {
X--- 120,137 ----
X      {
X        tputs(CL, 1, outc) ;
X        tc_move(4, 3) ;
X!       outstr("a   b   c   d   e   f   g   h") ;
X        for (y = 4; y < 21; y++)
X          {
X            tc_move(1, y) ;
X            if (y % 2)
X              SPRINTF(nextline, "%c|   |   |   |   |   |   |   |   |%c",
X!                               '1' + (y - 4) / 2, '1' + (y - 4) / 2) ;
X            else       SPRINTF(nextline, " +---+---+---+---+---+---+---+---+") ;
X            outstr(nextline) ;
X          }
X        tc_move(4, 21) ;
X!       outstr("a   b   c   d   e   f   g   h") ;
X      }
X    else if (width == PSIZE && height == PSIZE)
X      {
X***************
X*** 282,287 ****
X--- 282,288 ----
X  char *str ;
X  {
X    enum panel_type pt ;
X+   int black, white ;
X    int i ;
X  
X  /* Check for the three panel message types. */
X***************
X*** 297,304 ****
X      draw_string(othervals[(int) REMARK_MES].column,
X                  othervals[(int) REMARK_MES].row, str, TRUE) ;
X    else if (y == 237)                                    /* Score message. */
X!     draw_string(othervals[(int) SCORE_MES].column,
X!                 othervals[(int) SCORE_MES].row,  str, TRUE) ;
X  
X  /* Check for panel and cyclic items. */
X  
X--- 298,309 ----
X      draw_string(othervals[(int) REMARK_MES].column,
X                  othervals[(int) REMARK_MES].row, str, TRUE) ;
X    else if (y == 237)                                    /* Score message. */
X!     {
X!       SSCANF(str, "White: %1d, Black: %1d", &white, &black) ;
X!       SPRINTF(str, "White (O): %1d, Black (X): %1d", white, black) ;
X!       draw_string(othervals[(int) SCORE_MES].column,
X!                   othervals[(int) SCORE_MES].row,  str, TRUE) ;
X!     }
X  
X  /* Check for panel and cyclic items. */
X  
X
END_OF_FILE
if test 10028 -ne `wc -c <'patches02'`; then
    echo shar: \"'patches02'\" unpacked with wrong size!
fi
# end of 'patches02'
fi
echo shar: End of shell archive.
exit 0