[comp.sources.games] v11i061: reve - an othello game, Patch1a

billr@saab.CNA.TEK.COM (Bill Randle) (11/17/90)

Submitted-by: Rich Burridge <rburridge@sun.COM>
Posting-number: Volume 11, Issue 61
Archive-name: reve/Patch1a
Patch-To: reve: Volume 11, Issue 52-58
Environment: SunView, XView, X11R4, termcap

	[This was previously posted in comp.sources.games.bugs and
	is being reposted here for archiving.  -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 archive 1 (of 4)."
# Contents:  README.PCH1 patches01a
# Wrapped by billr@saab on Fri Nov 16 10:46:42 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README.PCH1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README.PCH1'\"
else
echo shar: Extracting \"'README.PCH1'\" \(9296 characters\)
sed "s/^X//" >'README.PCH1' <<'END_OF_FILE'
X
X/*
X *  Official patch #1 for Reve v1.1.
X *
X *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X *  All rights reserved.
X *
X *  Permission is granted to copy this patch, for redistribution
X *  in patch form only, provided the news headers in "substantially
X *  unaltered format" are retained, the introductory messages are not
X *  removed, and no monies are exchanged.
X *
X *  Permission is also granted to copy this patch, without the news
X *  headers, for the purposes of patching the Reve source and making
X *  an executable copy by means of compilation, provided that such
X *  copy will not be used for the purposes of competition in any othello
X *  tournaments, without prior permission from the authors.
X */
X
XCONTENTS:
X
X1. What is reve?
X2/ Changes made in this patch.
X3/ How to install this patch.
X
X----------------
X
X1/ What is reve?
X
XReve is an othello game. It works under SunView, XView, X11 (Xlib) and on
Xdumb tty terminals.
X
XReve has nine levels of difficulty. Levels 1-3 should be useful to beginners,
Xlevels 4-6 would satisfy amateurs, and the higher levels will give experts a
Xgood game. Level 8 (30 minutes) is the tournament level.
X
X----------------
X
X2/ Changes made in this patch.
X
X       * Time allocation function was out by 1. All the levels are shifted
X         by 1. This explains why computer move selection at level 1 is so
X         "slow".
X
X       * The sandwich routine in makemove.c, was accessing out of bounds
X         elements in the square array.
X
X       * The play_reve routine in rev_ip.c, was accessing out-of bounds
X         elements in the cpi, cpj and cpk arrays.
X
X       * black_dpy and white_dpy were declared inconsistently in main.c and
X         extern.h
X
X       * If you select White->human, then Black->computer, Reve correctly
X         plays the black computer move. If you then select Black->human
X         followed by White->computer, Reve incorrectly made another move
X         for black. There was a similar problem when starting a new game
X         with Black being played by computer.
X
X       * Fixed up a few other inconsistencies found by Saber-C.
X
X       * Extraction of the optional X11 display names for the -b and -w
X         options in get_options() was incorrect.
X
X       * If you used the suggest button, to get the computer to suggest a
X         move, it was decrementing the time allowed for the computer.
X
X       * Adjusted entries 2191 and 2917 of the Reve edge stability table
X         (in reve.edge2).
X
X       * Added in the code for a new tree algorithm from Yves (rev_eval.c
X         and rev_ip.c).
X
X       * Added a -r command line option, which will write some computer
X         move information to a reve.res file after each computer move. This
X         is probably only of use to people trying to improve the computer
X         algorithm. The manual pages has been updated.
X
X       * The computer move timing function in rev_ip.c now uses an alarm and
X         signal, so should be independent of the machine it's running on.
X
X       * Changed the variable "depth" to "level". As Reve now uses a timing
X         function to calculate it's computer moves, "depth" is not a true
X         indication of depth.
X
X       * Changed all #include <strings.h> to #include string.h or strings.h
X         depending upon whether SYSV was defined.
X
X       * The amount of computer time left for moves is now stored for each
X         move, so that if a move is undone against the computer, the previous
X         time left value is restored.
X
X       * Added in a -m command line line, which will start up Reve in
X         monochrome only, even on a color screen.
X
X       * The last move made is now shown by putting a black square around
X         the piece on the board. This is updated when a new move is made. The
X         manual pages have been changed to mention this.
X
X       * The "last" panel button has been replaced with a "moves?" panel
X         button (and rearranged to be alphabetical), which displays all the
X         valid moves at any particular time. This is very useful for
X         beginners and for teaching purposes. The manual pages have been
X         updated to reflect these changes.
X
X       * Added in more hooks for two screen support for the X11 version.
X
X       * From Jonathan I. Kamens <jik@pit-manager.MIT.EDU>
X         - Supplied a standard Imakefile for use with the X11 version of reve.
X           The Imakefile expects the manual pages in (nroff'able format) to
X           be in a file called reve.man, so reve.man needs to be renamed to
X           reve.man.text, and reve.6 needs to be renamed to reve.man. This is
X           detailed explicitly at the beginning of the instructions on how to
X           apply this patch.
X
X         - If X11 is defined (It's defined in the Imake-generated Makefile),
X           then include <X11/Xos.h>. That file does the index/strchr frobbing
X           automatically. Affects boardstuff.c and main.c
X
X         - Removed the definition of FREAD in reve.h. Some systems use
X           FREAD as a constant in /usr/include/sys/file.h. Incidentally,
X           it was no longer needed.
X
X         - Only do the index/strchr frobbing if X11 isn't defined. Change
X           to reve.h
X
X         - As far as I know, void-returning signal handlers are NOT part of
X           standard BSD4.3, so your #ifdef name for that is a bit wrong.
X           This name has been changed to INT_SIGNAL, and all the appropriate
X           files updated.
X
X       * Included a new XView version of Reve from Valerie Haecky. Adjusted
X         the "generic" sources to handle this. This involved moving
X         draw_piece and draw_rect into boardstuff.c, and *not* including
X         items.c when compiling the XView version. The XView version needs a
X         -DXVIEW flag to correct setup five #defines in reve.h. The
X         Makefile.dist has been updated to handle all this.
X
X       * The introductory messages in each file have been changed to try to
X         state our wishes in the correct manner.
X
X       * From Krishnamurthy Ganesan <ganesan@cs.fau.edu>
X         The processing of the readmask in the Xselect_input() routine in
X         x11.c was incorrect for the non-BSD4.3 option. The parentheses
X         were misplaced in two lines.
X
X       * From Gordon C. Galligher <telxon!ping!source@uunet.UU.NET>
X         Several icons in the images sub-directory have had their names
X         changed to less than 14 characters, so that they can work on
X         System V machines.
X
X       * There was an offset problem when drawing the inverted piece
X         for the first time on a mouse down. This was before it was
X         dragged around.
X
X----------------
X
X3/ How to install this patch.
X
XThis patch consists of four parts. Save each one first. You should then
Xuse Larry Wall's patch program to apply these changes. Assuming the four
Xfiles are called patch1a, patch1b, patch1c and patch1d, do the following:
X
Xcd reve_src        # directory where your reve source files are.
Xpatch <patch1a
Xpatch <patch1b
Xpatch <patch1c
Xpatch <patch1d
X
XNote that this will create one new file called Imakefile.
X
X*IMPORTANT*
X-----------
X
XAfter applying this patch you need to rename several files. This is for two
Xreasons:
X
X  1/ The Imakefile file expects the manual pages (in nroff'able format), to
X     be in a file called reve.man. So the two filename changes there are:
X
X       reve.man ==>  reve.man.text
X       reve.6   ==>  reve.man
X
X  2/ There are several files in the images sub-directory which are greater
X     then the 14 character filename limit allowed under System V. The
X     changes here are:
X
X       button.invert.icon   ==> Ibutton.icon
X       button.normal.icon   ==> Nbutton.icon
X       button.stencil.icon  ==> Sbutton.icon
X       cycle.glyph.icon     ==> Ncycle.icon
X       cycle.linvert.icon   ==> Lcycle.icon
X       cycle.rinvert.icon   ==> Rcycle.icon
X       cycle.stencil.icon   ==> Scycle.icon
X       reve.color.icon      ==> Creve.icon
X
XIf you are on a Unix machine, then you should run the following commands:
X
X       mv reve.man                   reve.man.text
X       mv reve.6                     reve.man
X       mv images/button.invert.icon  images/Ibutton.icon
X       mv images/button.normal.icon  images/Nbutton.icon
X       mv images/button.stencil.icon images/Sbutton.icon
X       mv images/cycle.glyph.icon    images/Ncycle.icon
X       mv images/cycle.linvert.icon  images/Lcycle.icon
X       mv images/cycle.rinvert.icon  images/Rcycle.icon
X       mv images/cycle.stencil.icon  images/Scycle.icon
X       mv images/reve.color.icon     images/Creve.icon
X 
XIf you are running reve on another O/S, then you should do the equivalent
Xof these moves.
X
XCopy Makefile.dist to Makefile, and adjust for your site. See the README
Xfile for things you might have to tweak in order to get Reve to work on
Xyour machine.
X
XYou will then have to do the appropriate make, to generate the graphics
Xversion you require. Do a "make help" to obtain more information on this.
X
XFinally, you should do a "make install". You will probably have to be
Xsuper-user to do this.
X
XIf you have any problems with Reve after applying this patch, and your
Xproblem is not listed in the TODO file, please let us know.
X
XRich Burridge           richb@Aus.Sun.COM
XYves Gallot             galloty@cernvax.cern.ch
X
END_OF_FILE
if test 9296 -ne `wc -c <'README.PCH1'`; then
    echo shar: \"'README.PCH1'\" unpacked with wrong size!
fi
# end of 'README.PCH1'
fi
if test -f 'patches01a' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches01a'\"
else
echo shar: Extracting \"'patches01a'\" \(43501 characters\)
sed "s/^X//" >'patches01a' <<'END_OF_FILE'
X
X------- patchlevel.h -------
XPrereq: 0
X*** /tmp/da28531	Fri Nov  9 10:13:21 1990
X--- patchlevel.h	Mon Nov  5 09:06:16 1990
X***************
X*** 6,16 ****
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is given to distribute these sources, as long as the
X!  *  introductory messages are not removed, and no monies are exchanged.
X   *
X!  *  You are forbidden from using Reve as is, or in a modified state, in
X!  *  any tournaments, without the permission of the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X--- 6,21 ----
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is granted to copy this source, for redistribution
X!  *  in source form only, provided the news headers in "substantially
X!  *  unaltered format" are retained, the introductory messages are not
X!  *  removed, and no monies are exchanged.
X   *
X!  *  Permission is also granted to copy this source, without the
X!  *  news headers, for the purposes of making an executable copy by
X!  *  means of compilation, provided that such copy will not be used
X!  *  for the purposes of competition in any othello tournaments, without
X!  *  prior permission from the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X***************
X*** 17,20 ****
X   *  (see README file), then an attempt will be made to fix them.
X   */
X  
X! #define  PATCHLEVEL  0
X--- 22,25 ----
X   *  (see README file), then an attempt will be made to fix them.
X   */
X  
X! #define  PATCHLEVEL  1
X*** /dev/null	Fri Nov  9 10:01:02 1990
X--- Imakefile	Fri Nov  9 10:15:13 1990
X***************
X*** 0 ****
X--- 1,88 ----
X+ 
X+ /*  @(#)Imakefile 1.2 90/11/09
X+  *
X+  *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X+  *  All rights reserved.
X+  *
X+  *  Permission is granted to copy this source, for redistribution
X+  *  in source form only, provided the news headers in "substantially
X+  *  unaltered format" are retained, the introductory messages are not
X+  *  removed, and no monies are exchanged.
X+  *
X+  *  Permission is also granted to copy this source, without the
X+  *  news headers, for the purposes of making an executable copy by
X+  *  means of compilation, provided that such copy will not be used
X+  *  for the purposes of competition in any othello tournaments, without
X+  *  prior permission from the authors.
X+  *
X+  *  No responsibility is taken for any errors inherent either
X+  *  to the comments or the code of this program, but if reported
X+  *  (see README file), then an attempt will be made to fix them.
X+  *
X+  *------------------------------------------------------------------------
X+  *  There are various small changes needed when compiling reve on
X+  *  different systems. These have been isolated here, and should be
X+  *  uncommented if needed.
X+  *
X+  *
X+  *  Not every version of Unix (in particular System V derivitives) has the
X+  *  select() system call. If your machine doesn't have this call, then you
X+  *  need to uncomment the following definition.
X+  *
X+  *NOSELECT        = -DNOSELECT
X+  *
X+  *
X+  *  Some machines do not have the usleep library function. If this is
X+  *  true, then you will need to uncomment this definition.
X+  *
X+  *NO_USLEEP      = -DNO_USLEEP
X+  */
X+ 
X+ #ifdef UltrixArchitecture
X+ NO_USLEEP	= -DNO_USLEEP
X+ #endif
X+ 
X+ /*  If you not running under a BSD4.3 derived system, the parameters
X+  *  to the select call are different, and this definition should be
X+  *  uncommented. You need to uncomment this for SunOS v3.x.
X+  *
X+  *SELTYPE        = -DNO_43SELECT
X+  */
X+ 
X+ 
X+ /*  YOU SHOULD NOT NEED TO MODIFY ANYTHING BELOW HERE.  */
X+      
X+ #if HasVoidSignalReturn == NO
X+ SIGRET	=	-DINT_SIGNAL
X+ #endif
X+      
X+ /*  Compilation flags and standard macro definitions.  */
X+ 
X+ SYS_LIBRARIES	= $(XLIB)     
X+ CDEFS		= $(NOSELECT) $(NO_USLEEP) $(EDGENAME) $(SELTYPE) \
X+ 		  $(SIGRET)
X+ DEFINES         = $(CDEFS) -DX11
X+ ETABLE		= reve.edgetable
X+ LIBDIR		= $(USRLIBDIR)/reve
X+      
X+ /*
X+  *  Full pathname of the reve edge table file. This can also be overridden
X+  *  with a command line option.
X+  */
X+ EDGENAMEFILE    = $(LIBDIR)/$(ETABLE)
X+ EDGENAME        = -DEDGENAME=\"$(EDGENAMEFILE)\"
X+ 
X+      
X+ SRCS		= boardstuff.c events.c items.c makemove.c main.c \
X+ 		  procs.c rev_eval.c rev_ip.c rev_iycp.c x11.c
X+ OBJS		= boardstuff.o events.o items.o makemove.o main.o \
X+ 		  procs.o rev_eval.o rev_ip.o rev_iycp.o x11.o
X+ 
X+ ComplexProgramTarget(reve)
X+ MakeDirectories(install,$(LIBDIR))
X+ InstallNonExec($(ETABLE),$(LIBDIR))
X+ 
X+ install:: install.man
X+ 
X+ $(ETABLE): reve.edge1 reve.edge2
X+ 	cat reve.edge1 reve.edge2 > $(ETABLE)
X
X------- CHANGES -------
X*** /tmp/da28687	Fri Nov  9 10:24:57 1990
X--- CHANGES	Fri Nov  9 10:17:27 1990
X***************
X*** 4,14 ****
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is given to distribute these sources, as long as the
X!  *  introductory messages are not removed, and no monies are exchanged.
X   *
X!  *  You are forbidden from using Reve as is, or in a modified state, in
X!  *  any tournaments, without the permission of the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X--- 4,19 ----
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is granted to copy this source, for redistribution
X!  *  in source form only, provided the news headers in "substantially
X!  *  unaltered format" are retained, the introductory messages are not
X!  *  removed, and no monies are exchanged.
X   *
X!  *  Permission is also granted to copy this source, without the
X!  *  news headers, for the purposes of making an executable copy by
X!  *  means of compilation, provided that such copy will not be used
X!  *  for the purposes of competition in any othello tournaments, without
X!  *  prior permission from the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X***************
X*** 17,22 ****
X--- 22,144 ----
X  
X  Reve change history.
X  ====================
X+ 
X+ v1.1 - patchlevel 1. 9th November 1990.
X+ 
X+        * Time allocation function was out by 1. All the levels are shifted
X+          by 1. This explains why computer move selection at level 1 is so
X+          "slow".
X+ 
X+        * The sandwich routine in makemove.c, was accessing out of bounds
X+          elements in the square array.
X+ 
X+        * The play_reve routine in rev_ip.c, was accessing out-of bounds
X+          elements in the cpi, cpj and cpk arrays.
X+ 
X+        * black_dpy and white_dpy were declared inconsistently in main.c and
X+          extern.h
X+ 
X+        * If you select White->human, then Black->computer, Reve correctly
X+          plays the black computer move. If you then select Black->human
X+          followed by White->computer, Reve incorrectly made another move
X+          for black. There was a similar problem when starting a new game
X+          with Black being played by computer.
X+ 
X+        * Fixed up a few other inconsistencies found by Saber-C.
X+ 
X+        * Extraction of the optional X11 display names for the -b and -w
X+          options in get_options() was incorrect.
X+ 
X+        * If you used the suggest button, to get the computer to suggest a
X+          move, it was decrementing the time allowed for the computer.
X+ 
X+        * Adjusted entries 2191 and 2917 of the Reve edge stability table
X+          (in reve.edge2).
X+ 
X+        * Added in the code for a new tree algorithm from Yves (rev_eval.c
X+          and rev_ip.c).
X+ 
X+        * Added a -r command line option, which will write some computer
X+          move information to a reve.res file after each computer move. This
X+          is probably only of use to people trying to improve the computer
X+          algorithm. The manual pages has been updated.
X+ 
X+        * The computer move timing function in rev_ip.c now uses an alarm and
X+          signal, so should be independent of the machine it's running on.
X+ 
X+        * Changed the variable "depth" to "level". As Reve now uses a timing
X+          function to calculate it's computer moves, "depth" is not a true
X+          indication of depth.
X+ 
X+        * Changed all #include <strings.h> to #include string.h or strings.h
X+          depending upon whether SYSV was defined.
X+ 
X+        * The amount of computer time left for moves is now stored for each
X+          move, so that if a move is undone against the computer, the previous
X+          time left value is restored.
X+ 
X+        * Added in a -m command line line, which will start up Reve in
X+          monochrome only, even on a color screen.
X+ 
X+        * The last move made is now shown by putting a black square around
X+          the piece on the board. This is updated when a new move is made. The
X+          manual pages have been changed to mention this.
X+ 
X+        * The "last" panel button has been replaced with a "moves?" panel
X+          button (and rearranged to be alphabetical), which displays all the
X+          valid moves at any particular time. This is very useful for
X+          beginners and for teaching purposes. The manual pages have been
X+          updated to reflect these changes.
X+ 
X+        * Added in more hooks for two screen support for the X11 version.
X+ 
X+        * From Jonathan I. Kamens <jik@pit-manager.MIT.EDU>
X+          - Supplied a standard Imakefile for use with the X11 version of reve.
X+            The Imakefile expects the manual pages in (nroff'able format) to
X+            be in a file called reve.man, so reve.man needs to be renamed to
X+            reve.man.text, and reve.6 needs to be renamed to reve.man. This is
X+            detailed explicitly at the beginning of the instructions on how to
X+            apply this patch.
X+ 
X+          - If X11 is defined (It's defined in the Imake-generated Makefile),
X+            then include <X11/Xos.h>. That file does the index/strchr frobbing
X+            automatically. Affects boardstuff.c and main.c
X+ 
X+          - Removed the definition of FREAD in reve.h. Some systems use
X+            FREAD as a constant in /usr/include/sys/file.h. Incidentally,
X+            it was no longer needed.
X+ 
X+          - Only do the index/strchr frobbing if X11 isn't defined. Change
X+            to reve.h
X+ 
X+          - As far as I know, void-returning signal handlers are NOT part of
X+            standard BSD4.3, so your #ifdef name for that is a bit wrong.
X+            This name has been changed to INT_SIGNAL, and all the appropriate
X+            files updated.
X+ 
X+        * Included a new XView version of Reve from Valerie Haecky. Adjusted
X+          the "generic" sources to handle this. This involved moving
X+          draw_piece and draw_rect into boardstuff.c, and *not* including
X+          items.c when compiling the XView version. The XView version needs a
X+          -DXVIEW flag to correct setup five #defines in reve.h. The
X+          Makefile.dist has been updated to handle all this.
X+ 
X+        * The introductory messages in each file have been changed to try to
X+          state our wishes in the correct manner.
X+ 
X+        * From Krishnamurthy Ganesan <ganesan@cs.fau.edu>
X+          The processing of the readmask in the Xselect_input() routine in
X+          x11.c was incorrect for the non-BSD4.3 option. The parentheses
X+          were misplaced in two lines.
X+ 
X+        * From Gordon C. Galligher <telxon!ping!source@uunet.UU.NET>
X+          Several icons in the images sub-directory have had their names
X+          changed to less than 14 characters, so that they can work on
X+          System V machines.
X+ 
X+        * There was an offset problem when drawing the inverted piece
X+          for the first time on a mouse down. This was before it was
X+          dragged around.
X  
X  v1.1 - patchlevel 0. 22nd October 1990.
X  
X
X------- Makefile.dist -------
X*** /tmp/da28690	Fri Nov  9 10:24:58 1990
X--- Makefile.dist	Thu Nov  8 10:35:39 1990
X***************
X*** 6,16 ****
X  #  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X  #  All rights reserved.
X  #
X! #  Permission is given to distribute these sources, as long as the
X! #  introductory messages are not removed, and no monies are exchanged.
X  #
X! #  You are forbidden from using Reve as is, or in a modified state, in
X! #  any tournaments, without the permission of the authors.
X  #
X  #  No responsibility is taken for any errors inherent either
X  #  to the comments or the code of this program, but if reported
X--- 6,21 ----
X  #  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X  #  All rights reserved.
X  #
X! #  Permission is granted to copy this source, for redistribution
X! #  in source form only, provided the news headers in "substantially
X! #  unaltered format" are retained, the introductory messages are not
X! #  removed, and no monies are exchanged.
X  #
X! #  Permission is also granted to copy this source, without the
X! #  news headers, for the purposes of making an executable copy by
X! #  means of compilation, provided that such copy will not be used
X! #  for the purposes of competition in any othello tournaments, without
X! #  prior permission from the authors.
X  #
X  #  No responsibility is taken for any errors inherent either
X  #  to the comments or the code of this program, but if reported
X***************
X*** 52,63 ****
X  #
X  #SELTYPE        = -DNO_43SELECT
X  #-----------------------------------------------------------------------
X! #  If you are not running under a BSD4.3 derived system, then the
X! #  second parameter to a signal call is a pointer to an integer function,
X! #  and this definition needs to be uncommented. You need to uncomment this
X! #  for SunOS v3.x.
X  #
X! #SIGRET         = -DNO_4_3SIGNAL
X  #-----------------------------------------------------------------------
X  #  If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
X  #  SVAT, or Xenix286, then you will need to uncomment this definition.
X--- 57,67 ----
X  #
X  #SELTYPE        = -DNO_43SELECT
X  #-----------------------------------------------------------------------
X! #  If you are running on a system, where the second parameter to a signal
X! #  call is a pointer to an integer function, then this definition needs
X! #  to be uncommented.
X  #
X! #SIGRET         = -DINT_SIGNAL
X  #-----------------------------------------------------------------------
X  #  If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
X  #  SVAT, or Xenix286, then you will need to uncomment this definition.
X***************
X*** 75,81 ****
X  #  If you are compiling the XView version, then the following two lines
X  #  should be uncommented, and set appropriately.
X  #
X! #XVIEWINCDIR      = -I$(OPENWINHOME)/include
X  #XVIEWLIBDIR      = -L$(OPENWINHOME)/lib
X  #
X  #===========================================================================
X--- 79,85 ----
X  #  If you are compiling the XView version, then the following two lines
X  #  should be uncommented, and set appropriately.
X  #
X! #XVIEWINCDIR      = -I$(OPENWINHOME)/include -DXVIEW
X  #XVIEWLIBDIR      = -L$(OPENWINHOME)/lib
X  #
X  #===========================================================================
X***************
X*** 96,109 ****
X  #
X  #==========================================================================
X  
X  BINARIES        = sv_reve tty_reve xreve xv_reve
X  ETABLE		= reve.edgetable
X  
X  CC              = cc
X  
X! STDSRCS         = boardstuff.c events.c items.c makemove.c main.c \
X  		  procs.c rev_eval.c rev_ip.c rev_iycp.c
X! STDOBJS         = boardstuff.o events.o items.o makemove.o main.o \
X  		  procs.o rev_eval.o rev_ip.o rev_iycp.o
X  
X  GSRCS           = sunview.c tty.c x11.c xview.c
X--- 100,115 ----
X  #
X  #==========================================================================
X  
X+ .KEEP_STATE:
X+ 
X  BINARIES        = sv_reve tty_reve xreve xv_reve
X  ETABLE		= reve.edgetable
X  
X  CC              = cc
X  
X! STDSRCS         = boardstuff.c events.c makemove.c main.c \
X  		  procs.c rev_eval.c rev_ip.c rev_iycp.c
X! STDOBJS         = boardstuff.o events.o makemove.o main.o \
X  		  procs.o rev_eval.o rev_ip.o rev_iycp.o
X  
X  GSRCS           = sunview.c tty.c x11.c xview.c
X***************
X*** 111,125 ****
X  IDIR		= images
X  IMAGES          = $(IDIR)/black.icon \
X  		  $(IDIR)/reve.icon \
X! 		  $(IDIR)/reve.color.icon \
X  		  $(IDIR)/white.icon \
X! 		  $(IDIR)/button.invert.icon \
X! 		  $(IDIR)/button.normal.icon \
X! 		  $(IDIR)/button.stencil.icon \
X! 		  $(IDIR)/cycle.glyph.icon \
X! 		  $(IDIR)/cycle.linvert.icon \
X! 		  $(IDIR)/cycle.rinvert.icon \
X! 		  $(IDIR)/cycle.stencil.icon \
X  		  $(IDIR)/hglass.cursor \
X  		  $(IDIR)/nocur.cursor
X  
X--- 117,131 ----
X  IDIR		= images
X  IMAGES          = $(IDIR)/black.icon \
X  		  $(IDIR)/reve.icon \
X! 		  $(IDIR)/Creve.icon \
X  		  $(IDIR)/white.icon \
X! 		  $(IDIR)/Ibutton.icon \
X! 		  $(IDIR)/Nbutton.icon \
X! 		  $(IDIR)/Sbutton.icon \
X! 		  $(IDIR)/Ncycle.icon \
X! 		  $(IDIR)/Lcycle.icon \
X! 		  $(IDIR)/Rcycle.icon \
X! 		  $(IDIR)/Scycle.icon \
X  		  $(IDIR)/hglass.cursor \
X  		  $(IDIR)/nocur.cursor
X  
X***************
X*** 130,136 ****
X  SFILES2		= boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
X  SFILES3         = $(OTHERS)
X  SFILES4         = tty.c x11.c xview.c
X! SFILES5		= sunview.c $(IDIR)
X  SFILES6		= reve.edge1
X  SFILES7		= reve.edge2
X  
X--- 136,142 ----
X  SFILES2		= boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
X  SFILES3         = $(OTHERS)
X  SFILES4         = tty.c x11.c xview.c
X! SFILES5		= sunview.c $(IDIR) Imakefile
X  SFILES6		= reve.edge1
X  SFILES7		= reve.edge2
X  
X***************
X*** 156,171 ****
X  
X  all:            $(BINARIES)
X  
X! sunview:        $(STDOBJS) sunview.o
X! 		$(CC) -o sv_reve $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
X  		-cp sv_reve reve
X  
X! tty:            $(STDOBJS) tty.o
X! 		$(CC) -o tty_reve $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
X  		-cp tty_reve reve
X  
X! x11:            $(STDOBJS) x11.o
X! 		$(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) x11.o \
X  			       $(X11LIBS)
X  		-cp xreve reve
X  
X--- 162,180 ----
X  
X  all:            $(BINARIES)
X  
X! sunview:        $(STDOBJS) items.o sunview.o
X! 		$(CC) -o sv_reve $(CFLAGS) $(STDOBJS) \
X! 				items.o sunview.o $(SVIEWLIBS)
X  		-cp sv_reve reve
X  
X! tty:            $(STDOBJS) items.o tty.o
X! 		$(CC) -o tty_reve $(CFLAGS) $(STDOBJS) \
X! 				items.o tty.o $(TTYLIBS)
X  		-cp tty_reve reve
X  
X! x11:            $(STDOBJS) items.o x11.o
X! 		$(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) \
X! 				items.o x11.o \
X  			       $(X11LIBS)
X  		-cp xreve reve
X  
X***************
X*** 187,199 ****
X  clean:;         rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core
X  
X  lint:		lint-sunview lint-tty lint-xview lint-x11
X! lint-sunview:;	lint $(CDEFS) $(STDSRCS) sunview.c $(SVIEWLIBS)
X! lint-tty:;	lint $(CDEFS) $(STDSRCS) tty.c $(TTYLIBS)
X  lint-xview:;	lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS) 
X! lint-x11:;	lint $(CDEFS) $(STDSRCS) x11.c $(X11LIBS) 
X  
X  saber:		$(STDSRCS) x11.c
X! 		#load $(LDFLAGS) $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
X  
X  shar:;          shar.script $(SFILES1) > Part1
X  		shar.script $(SFILES2) > Part2
X--- 196,208 ----
X  clean:;         rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core
X  
X  lint:		lint-sunview lint-tty lint-xview lint-x11
X! lint-sunview:;	lint $(CDEFS) $(STDSRCS) items.c sunview.c $(SVIEWLIBS)
X! lint-tty:;	lint $(CDEFS) $(STDSRCS) items.c tty.c $(TTYLIBS)
X  lint-xview:;	lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS) 
X! lint-x11:;	lint $(CDEFS) $(STDSRCS) items.c x11.c $(X11LIBS) 
X  
X  saber:		$(STDSRCS) x11.c
X! 		#load $(LDFLAGS) $(CDEFS) $(STDSRCS) items.c x11.c $(X11LIBS)
X  
X  shar:;          shar.script $(SFILES1) > Part1
X  		shar.script $(SFILES2) > Part2
X***************
X*** 204,210 ****
X  		shar.script $(SFILES7) > Part7
X  
X  create:         SCCS
X! 		-sccs create $(STDSRCS) $(GSRCS) $(HDRS) $(IMAGES) $(OTHERS)
X  
X  SCCS:
X  		mkdir SCCS
X--- 213,220 ----
X  		shar.script $(SFILES7) > Part7
X  
X  create:         SCCS
X! 		-sccs create $(STDSRCS) items.c $(GSRCS) $(HDRS) \
X! 			     $(IMAGES) $(OTHERS)
X  
X  SCCS:
X  		mkdir SCCS
X
X------- README -------
X*** /tmp/da28693	Fri Nov  9 10:24:59 1990
X--- README	Wed Nov  7 11:41:54 1990
X***************
X*** 4,14 ****
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is given to distribute these sources, as long as the
X!  *  introductory messages are not removed, and no monies are exchanged.
X   *
X!  *  You are forbidden from using Reve as is, or in a modified state, in
X!  *  any tournaments, without the permission of the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X--- 4,19 ----
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is granted to copy this source, for redistribution
X!  *  in source form only, provided the news headers in "substantially
X!  *  unaltered format" are retained, the introductory messages are not
X!  *  removed, and no monies are exchanged.
X   *
X!  *  Permission is also granted to copy this source, without the
X!  *  news headers, for the purposes of making an executable copy by
X!  *  means of compilation, provided that such copy will not be used
X!  *  for the purposes of competition in any othello tournaments, without
X!  *  prior permission from the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X***************
X*** 187,193 ****
X  Steve Misrack, Hugues Leroy, Linton Miller, Mike Stump, D. Hugh Redelmeier,
X  Scott W. Danielson, Gary D. Kline, Kjetil Torgrim Homme, Peter Johansson,
X  Alfred Nathaniel, Arnold Gill, Martin Chudley, W Mat Waites, Keith Moore,
X! John Eras and Heather Rose for bug reports and/or bug fixes plus suggested
X  enhancements.
X  
X  Suggestions for furthur improvement would be most welcome, plus bugs,
X--- 192,199 ----
X  Steve Misrack, Hugues Leroy, Linton Miller, Mike Stump, D. Hugh Redelmeier,
X  Scott W. Danielson, Gary D. Kline, Kjetil Torgrim Homme, Peter Johansson,
X  Alfred Nathaniel, Arnold Gill, Martin Chudley, W Mat Waites, Keith Moore,
X! John Eras, Heather Rose, Jonathan I. Kamens, Krishnamurthy Ganesan and
X! Gordon C. Galligher for bug reports and/or bug fixes plus suggested
X  enhancements.
X  
X  Suggestions for furthur improvement would be most welcome, plus bugs,
X
X------- TODO -------
X*** /tmp/da28696	Fri Nov  9 10:24:59 1990
X--- TODO	Fri Nov  9 09:38:18 1990
X***************
X*** 4,14 ****
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is given to distribute these sources, as long as the
X!  *  introductory messages are not removed, and no monies are exchanged.
X   *
X!  *  You are forbidden from using Reve as is, or in a modified state, in
X!  *  any tournaments, without the permission of the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X--- 4,19 ----
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is granted to copy this source, for redistribution
X!  *  in source form only, provided the news headers in "substantially
X!  *  unaltered format" are retained, the introductory messages are not
X!  *  removed, and no monies are exchanged.
X   *
X!  *  Permission is also granted to copy this source, without the
X!  *  news headers, for the purposes of making an executable copy by
X!  *  means of compilation, provided that such copy will not be used
X!  *  for the purposes of competition in any othello tournaments, without
X!  *  prior permission from the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X***************
X*** 20,37 ****
X  
X  1/ Finish off the X11 "two screens on two machines" version. The hooks are
X     all in place, but not enough spare time...
X  
X  2/ Allow the computer to play itself. Currently this option is disabled,
X     because of the inability with some of the graphics versions to interrupt
X     it, once it's started.
X  
X! 3/ From Valerie Haecky <vmh@Eng>
X!    It might be nice to have an additional button for <help>. It pops up an
X!    alert, giving a short summary of the rules and explaining things, like
X!    how Difficulty is measured.
X  
X! 4/ With the XView version, disable MS_LEFT whilst the computer is having
X!    its move. At the moment, if you press the left mouse button while the
X!    computer is doing something, the server will hang.
X  
X! 5/ The color icon doesn't display properly with the XView version.
X--- 25,143 ----
X  
X  1/ Finish off the X11 "two screens on two machines" version. The hooks are
X     all in place, but not enough spare time...
X+    ~ The cursors in x11.c will need to be allocated for each screen
X+      separately.
X+    ~ In the process_event routine, only allow the FRAME_REPAINT event
X+      through if it's now this persons go. Otherwise output a panel message
X+      telling the user to wait her/his turn.
X+    ~ Changing the Black: and White: cyclic items should have a null effect
X+      if dtype is XTWO. Output a message to this effect.
X+    ~ If dtype is XTWO, then message and draw_piece should output to both
X+      screens. There are probably other routines where this should be the case.
X+    ~ There will be a few other places where certain routines will need to
X+      output to both displays if dtype is XTWO.
X  
X  2/ Allow the computer to play itself. Currently this option is disabled,
X     because of the inability with some of the graphics versions to interrupt
X     it, once it's started.
X  
X! 3/ From Valerie Haecky <vmh@Eng.Sun.COM>
X!    It might be nice to have an additional button for <help>.
X!    It pops up an alert, giving a short summary of the rules
X!    and explaining non-obvious things, like how Difficulty is measured.
X  
X! 4/ There are several problems outstanding with the XView version:
X!    ~ **IMPORTANT** Need to find some way to disable MS_LEFT whilst the
X!                    computer is having its move. At the moment, if you press
X!                    the left mouse button while the computer is doing something,
X!                    the server will hang.
X!    ~ The game panel doesn't correct repaint itself. You need to select
X!      "Refresh" from the frame menu.
X!    ~ The hourglass cursor should be drawn in XOR mode.
X!    ~ The board window should not have a window menu.
X!    ~ The game board isn't correctly painted with the -m command line option.
X!    ~ When you click to get the panel window to the top, the game board should
X!      also be raised.
X!    ~ The alignment and size of some of the items needs to be adjusted to be
X!      more consistent.
X!    ~ The color icon doesn't get displayed properly.
X!    ~ Would be nice to be able to close the game panel and leave the board
X!      window open. Status information could be written to a title line and a
X!      window footer (messages such as the number of stones each player
X!      currently has; whose turn it is to move could be placed in the title
X!      line, and panel messages such as invalid move could be written to the
X!      footer.
X  
X! 5/ There appears to be a bug with the X11 implementation on an IBM RS6000.
X!    When the computer moves a piece from the upper-left border to its place,
X!    a "trace" appears along its path. The color of this trace is the color of
X!    the background of the screen.
X! 
X! 6/ Need to allow options like -scale through on the command line. This can
X!    be done by have an init_graphics() routine that gets called right at
X!    the start, which strips off graphics specific options.
X! 
X! 7/ Need to add in the ability to show the last move, and show all moves to
X!    the tty version.
X! 
X! 8/ From Valerie Haecky <vmh@Eng.Sun.COM>
X!    Display the time left for the user[s] and computer.
X! 
X! 9/ From Valerie Haecky <vmh@Eng.Sun.COM>
X!    Showing the last move could be optional.
X! 
X! 10/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     ~ Provide an option or button to toggle the animation of the computer
X!       piece from the top-left corner onto the board. On slow workstations,
X!       this is embarrassingly flickery and quite distracting.
X! 
X!     ~ Ditto for the flash of the turned over pieces - it slows down the game
X!       when you just want a quick game.
X! 
X!     ~ Add the ability to change the default background colour of the board to
X!       a (not too bright !) green colour. After all, that's the colour of the
X!       othello sets you buy in the shops!
X!  
X!     [I'll do these with settable resources. I'll allow you to set some of
X!      them on the command line, and I'll add a .reverc file, which will be read
X!      from the users home directory. For the X11/XView versions, I'll allow the
X!      resources to be set in all the standard X places, and the .reverc file can
X!      superceed them - Rich.]
X! 
X! 11/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     Supply a way of forcing the computer to move before its search is complete.
X!     This would be very handy at the higher levels.
X! 
X! 12/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     Allow the player to go forwards through a game as well as backwards (Undo
X!     only performs the latter and not the former). In other words, "undo the
X!     Undo" !
X! 
X! 13/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     As the computer is making it's move, highlight the best square found so
X!     far during the computer search and display its rating in the Notes section.
X! 
X! 14/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     What about a 'Play Next Best' option? This would undo the last computer
X!     move and play the second best move found rather than the best one. If
X!     selected again, there would be another undo and the third best move would
X!     be made instead and so on, until the move list is exhausted. It's great
X!     for trying out different moves in the same position.
X! 
X! 15/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     Countdown clocks for blitz games (first to hit 00:00:00 loses if the game
X!     is still in progress).
X! 
X! 16/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     Board editing.
X! 
X! 17/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     A display of the full tree for the best move rather than just the best
X!     move itself.
X! 
X! 18/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     A resign feature if the search shows a completely lost endgame.
X! 
X! 19/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
X!     A 'I will win/lose in x moves' announcement if a forced win/loss is
X!     detected.
X
X------- boardstuff.c -------
X*** /tmp/da28701	Fri Nov  9 10:25:30 1990
X--- boardstuff.c	Fri Nov  9 08:57:42 1990
X***************
X*** 7,17 ****
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is given to distribute these sources, as long as the
X!  *  introductory messages are not removed, and no monies are exchanged.
X   *
X!  *  You are forbidden from using Reve as is, or in a modified state, in
X!  *  any tournaments, without the permission of the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X--- 7,22 ----
X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X   *  All rights reserved.
X   *
X!  *  Permission is granted to copy this source, for redistribution
X!  *  in source form only, provided the news headers in "substantially
X!  *  unaltered format" are retained, the introductory messages are not
X!  *  removed, and no monies are exchanged.
X   *
X!  *  Permission is also granted to copy this source, without the
X!  *  news headers, for the purposes of making an executable copy by
X!  *  means of compilation, provided that such copy will not be used
X!  *  for the purposes of competition in any othello tournaments, without
X!  *  prior permission from the authors.
X   *
X   *  No responsibility is taken for any errors on inaccuracies inherent
X   *  either to the comments or the code of this program, but if reported
X***************
X*** 18,35 ****
X   *  (see README file), then an attempt will be made to fix them.
X   */
X  
X! #include <stdio.h>
X  #include <ctype.h>
X- 
X- #ifndef SYSV
X  #include <sys/time.h>
X- #endif /*SYSV*/
X  
X! #include "color.h"
X! #include "reve.h"
X! #include "extern.h"
X  
X- 
X  void
X  animate_move(move)
X  int move ;
X--- 23,38 ----
X   *  (see README file), then an attempt will be made to fix them.
X   */
X  
X! #include "reve.h"
X! #include "color.h"
X! #include "extern.h"
X  #include <ctype.h>
X  #include <sys/time.h>
X  
X! #ifdef X11
X! #include <X11/Xos.h>
X! #endif /*X11*/
X  
X  void
X  animate_move(move)
X  int move ;
X***************
X*** 50,56 ****
X          {
X  #ifndef SYSV
X            set_timer() ;
X! #endif /*SYSV*/
X            x0 = x ;
X            y0 = y ;
X            x += move_delta ;
X--- 53,59 ----
X          {
X  #ifndef SYSV
X            set_timer() ;
X! #endif /*!SYSV*/
X            x0 = x ;
X            y0 = y ;
X            x += move_delta ;
X***************
X*** 63,69 ****
X            draw_piece(WHITE, x0, CY+y0, RINV) ;
X  #ifndef SYSV
X            nap_upto(1) ;
X! #endif /*SYSV*/
X          }
X        draw_piece(WHITE, x, CY+y, RINV) ;
X      }
X--- 66,72 ----
X            draw_piece(WHITE, x0, CY+y0, RINV) ;
X  #ifndef SYSV
X            nap_upto(1) ;
X! #endif /*!SYSV*/
X          }
X        draw_piece(WHITE, x, CY+y, RINV) ;
X      }
X***************
X*** 77,83 ****
X          {
X  #ifndef SYSV
X            set_timer() ;
X! #endif /*SYSV*/
X            x0 = x ;
X            y0 = y ;
X            y += move_delta ;
X--- 80,86 ----
X          {
X  #ifndef SYSV
X            set_timer() ;
X! #endif /*!SYSV*/
X            x0 = x ;
X            y0 = y ;
X            y += move_delta ;
X***************
X*** 90,96 ****
X            draw_piece(WHITE, x0, CY+y0, RINV) ;
X  #ifndef SYSV
X            nap_upto(1) ;
X! #endif /*SYSV*/
X          }
X        draw_piece(WHITE, x, CY+y, RINV) ;
X      }
X--- 93,99 ----
X            draw_piece(WHITE, x0, CY+y0, RINV) ;
X  #ifndef SYSV
X            nap_upto(1) ;
X! #endif /*!SYSV*/
X          }
X        draw_piece(WHITE, x, CY+y, RINV) ;
X      }
X***************
X*** 112,118 ****
X        who_wins() ;
X        last_cmode = cmode ;     /* Save previous value in case of undo. */
X        cmode = GAME_OVER ;
X!       message(PANEL_MES, "Game over") ;
X        return(FALSE) ;
X      }
X    if ((move = valid_move(&board, player)) == FALSE)
X--- 115,121 ----
X        who_wins() ;
X        last_cmode = cmode ;     /* Save previous value in case of undo. */
X        cmode = GAME_OVER ;
X!       message(PANEL_MES, "***GAME OVER***") ;
X        return(FALSE) ;
X      }
X    if ((move = valid_move(&board, player)) == FALSE)
X***************
X*** 126,132 ****
X            who_wins() ;
X            last_cmode = cmode ;
X            cmode = GAME_OVER ;
X!           message(PANEL_MES, "Game over") ;
X          }
X        return(FALSE) ;
X      }
X--- 129,135 ----
X            who_wins() ;
X            last_cmode = cmode ;
X            cmode = GAME_OVER ;
X!           message(PANEL_MES, "***GAME OVER***") ;
X          }
X        return(FALSE) ;
X      }
X***************
X*** 148,153 ****
X--- 151,157 ----
X      else
X        { 
X          if (cmode != GAME_OVER) cmode = (enum cantype) ((int) cmode - 1) ;
X+         next_player = OPPONENT(next_player) ;
X          return ;
X        }
X  }
X***************
X*** 180,185 ****
X--- 184,216 ----
X  }
X  
X  
X+ void
X+ draw_piece(piece, x, y, op)    /* Draw an othello piece on the board. */
X+ int piece, x, y ;
X+ enum optype op ;
X+ {
X+   switch (piece)
X+     {
X+       case BLACK : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
X+                                 P_BLACK, P_BLACK) ;
X+                    break ;
X+       case WHITE : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
X+                                 P_BLACK, P_WHITE) ;
X+     }
X+ }
X+    
X+  
X+ void
X+ draw_rect(x1, y1, x2, y2, op, color)
X+ int x1, y1, x2, y2, op, color ;
X+ {
X+   draw_line(x1, y1, x2, y1, op, color) ;
X+   draw_line(x1, y1, x1, y2, op, color) ;
X+   draw_line(x2, y1, x2, y2, op, color) ;
X+   draw_line(x1, y2, x2, y2, op, color) ;
X+ }
X+ 
X+ 
X  formfliplist(move, player)
X  int move, player ;
X  {        
X***************
X*** 196,201 ****
X--- 227,233 ----
X    moves[n].move = move ;
X    moves[n].note = note ;
X    moves[n].player = player ;
X+   moves[n].timeleft = timeleft ;
X  
X    cnt = count(&board, player) ;
X    return(cnt - old_cnt - 1) ;
X***************
X*** 263,269 ****
X    initboard() ;
X    last_move = -1 ;
X    init_canvas() ;
X!   message(NOTES_MES, "") ;
X    while (fgets(buf, MAXLINE, fp) != NULL)
X      {
X        if (buf[0] == '\n' || buf[0] == '#') continue ;
X--- 295,301 ----
X    initboard() ;
X    last_move = -1 ;
X    init_canvas() ;
X!   message(EVAL_MES, "") ;
X    while (fgets(buf, MAXLINE, fp) != NULL)
X      {
X        if (buf[0] == '\n' || buf[0] == '#') continue ;
X***************
X*** 286,292 ****
X        if (lptr < mptr) next_player = BLACK ;    /* Black move? */
X        else             next_player = WHITE ;
X        SSCANF(lptr, "<%c-%c>", &row, &col) ;
X!       if (load_move(moveno, row, col) == 0)
X          {
X            SPRINTF(buf, "Load error: invalid move <%c-%c> on line %d",
X                                      row, col, move) ;
X--- 318,324 ----
X        if (lptr < mptr) next_player = BLACK ;    /* Black move? */
X        else             next_player = WHITE ;
X        SSCANF(lptr, "<%c-%c>", &row, &col) ;
X!       if (load_move(row, col) == 0)
X          {
X            SPRINTF(buf, "Load error: invalid move <%c-%c> on line %d",
X                                      row, col, move) ;
X***************
X*** 309,318 ****
X  }
X  
X  
X! load_move(n, col, row)
X! int n, col, row ;
X  {
X!   int i, taken, x, y ;
X  
X    if (row < '1' || row > '8') return(0) ;
X    if (isupper(col)) col = tolower(col) ;
X--- 341,350 ----
X  }
X  
X  
X! load_move(col, row)
X! int col, row ;
X  {
X!   int i, x, y ;
X  
X    if (row < '1' || row > '8') return(0) ;
X    if (isupper(col)) col = tolower(col) ;
X***************
X*** 319,325 ****
X    if (col < 'a' || col > 'h') return(0) ;
X    move = (row - '1') * BOARD_SIZE + (col - 'a') ;
X    if (legal(move, next_player, &board) == FALSE) return(0) ;
X!   taken = formfliplist(move, next_player) ;
X    batch(IS_ON) ;
X    FOR_BOARD(i)
X      if (board.square[i] != old_board.square[i])
X--- 351,357 ----
X    if (col < 'a' || col > 'h') return(0) ;
X    move = (row - '1') * BOARD_SIZE + (col - 'a') ;
X    if (legal(move, next_player, &board) == FALSE) return(0) ;
X!   (void) formfliplist(move, next_player) ;
X    batch(IS_ON) ;
X    FOR_BOARD(i)
X      if (board.square[i] != old_board.square[i])
X***************
X*** 347,353 ****
X    if (elapsed > n) return ;
X    usleep((unsigned) (n - elapsed)) ;
X  }
X! #endif /*SYSV*/
X  
X  
X  void
X--- 379,385 ----
X    if (elapsed > n) return ;
X    usleep((unsigned) (n - elapsed)) ;
X  }
X! #endif /*!SYSV*/
X  
X  
X  void
X***************
X*** 399,405 ****
X  void
X  set_score()
X  {
X!   SPRINTF(line, "Black: %2d, White: %2d",
X                   count(&board, BLACK), count(&board, WHITE)) ;
X    message(SCORE_MES, line) ;
X  }
X--- 431,437 ----
X  void
X  set_score()
X  {
X!   SPRINTF(line, "Stones: Black: %2d  White: %2d",
X                   count(&board, BLACK), count(&board, WHITE)) ;
X    message(SCORE_MES, line) ;
X  }
X***************
X*** 422,431 ****
X  
X    GETTIMEOFDAY(&tp, &tzp) ;
X  }
X! #endif /*SYSV*/
X  
X  
X  void
X  show_suggestion()
X  {
X    enum optype rop ;
X--- 454,528 ----
X  
X    GETTIMEOFDAY(&tp, &tzp) ;
X  }
X! #endif /*!SYSV*/
X  
X  
X  void
X+ show_all(state)
X+ enum bltype state ;
X+ {
X+   int color, d, i, x, y ;
X+ 
X+   d = (int) cur_dpyno ;
X+   batch(IS_ON) ;
X+   if (state == IS_ON)
X+     {
X+       FOR_BOARD(i) s_all.square[i] = FREE ;
X+       FOR_BOARD(i)
X+         if (board.square[i] == FREE && legal(i, next_player, &board))
X+           {
X+             s_all.square[i] = next_player ;
X+             if (iscolor[d])
X+               {
X+                 get_xy(i, &x, &y) ;
X+                 draw_stencil(x, CY+y, PSIZE, PSIZE, RSRC, C_BLACK,
X+                              P_WHITE, P_WHITE) ;
X+               }
X+             else
X+               {
X+                 x = BBORDER + ((i & 7)  + 1) * CELL_SIZE - CELL_SIZE / 2 ;
X+                 y = BBORDER + ((i >> 3) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
X+                 draw_line(x-5, CY+y,   x+5, CY+y,   RSRC, C_BLACK) ;
X+                 draw_line(x,   CY+y+5, x,   CY+y-5, RSRC, C_BLACK) ;
X+               }
X+           }
X+     }
X+   else
X+     {
X+       FOR_BOARD(i)
X+         if (s_all.square[i] != FREE)
X+           {
X+             s_all.square[i] = FREE ;
X+             x = (i & 7)  * CELL_SIZE + BBORDER + 1 ;
X+             y = (i >> 3) * CELL_SIZE + BBORDER + 1 ;  
X+             color = (iscolor[d]) ? C_LBROWN : C_WHITE ;
X+             color_area(x, CY + y, CELL_SIZE - 2, CELL_SIZE - 2, color) ;
X+           }
X+     }    
X+   batch(IS_OFF) ;
X+   show_moves = (int) state ;
X+ }
X+ 
X+ 
X+ void
X+ show_last(move, state)
X+ int move ;
X+ enum bltype state ;
X+ {
X+   int color, x, y ;
X+ 
X+   if (move == -1) return ;
X+   if (iscolor[(int) cur_dpyno]) color = (state == IS_ON) ? C_BLACK : C_LBROWN ;
X+   else                          color = (state == IS_ON) ? C_BLACK : C_WHITE ;
X+ 
X+   x = (move & 7)  * CELL_SIZE + BBORDER ;
X+   y = (move >> 3) * CELL_SIZE + BBORDER ;
X+   draw_rect(x + 2,             CY + y + 2,
X+             x + CELL_SIZE - 2, CY + y + CELL_SIZE - 2, RSRC, color) ;
X+ }
X+ 
X+ 
X+ void
X  show_suggestion()
X  {
X    enum optype rop ;
X***************
X*** 450,455 ****
X--- 547,554 ----
X  {
X    int flips, i, piece, x, y ;
X   
X+   show_all(IS_OFF) ;
X+   show_last(last_move, IS_OFF) ;
X    show_suggestion() ;
X    for (flips = 0; flips < 4; flips++)
X      {
X***************
X*** 468,473 ****
X--- 567,574 ----
X        batch(IS_OFF) ;
X        PAUSE ;
X      }
X+   show_last(move, IS_ON) ;
X+   last_move = move ;
X    set_score() ;
X    set_turn(OPPONENT(player)) ;
X    message(TURN_MES, line) ;
X***************
X*** 475,484 ****
X      if ((player == BLACK && items[(int) BLACK_PLAYS].value == COMPUTER) ||
X          (player == WHITE && items[(int) WHITE_PLAYS].value == COMPUTER))
X        {
X!         SPRINTF(line, "%s: <%c-%c> note : %ld",
X                  (player == BLACK) ? "Black" : "White",
X                  (move & 7) + 'a', (move >> 3) + '1', note) ;
X!         message(NOTES_MES, line) ;
X        }
X  }
X  
X--- 576,585 ----
X      if ((player == BLACK && items[(int) BLACK_PLAYS].value == COMPUTER) ||
X          (player == WHITE && items[(int) WHITE_PLAYS].value == COMPUTER))
X        {
X!         SPRINTF(line, "%s: <%c-%c> eval : %ld",
X                  (player == BLACK) ? "Black" : "White",
X                  (move & 7) + 'a', (move >> 3) + '1', note) ;
X!         message(EVAL_MES, line) ;
X        }
X  }
X  
X
X
END_OF_FILE
if test 43501 -ne `wc -c <'patches01a'`; then
    echo shar: \"'patches01a'\" unpacked with wrong size!
fi
# end of 'patches01a'
fi
echo shar: End of archive 1 \(of 4\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0