[comp.sources.games.bugs] Official patch #2 for reve v1.1

richb@sunaus.oz (Rich Burridge) (11/28/90)

/*
 *  Official patch #2 for Reve v1.1.
 *
 *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
 *  All rights reserved.
 *
 *  Permission is granted to copy this patch, for redistribution
 *  in patch form only, provided the news headers in "substantially
 *  unaltered format" are retained, the introductory messages are not
 *  removed, and no monies are exchanged.
 *
 *  Permission is also granted to copy this patch, without the news
 *  headers, for the purposes of patching the Reve source and making
 *  an executable copy by means of compilation, provided that such
 *  copy will not be used for the purposes of competition in any othello
 *  tournaments, without prior permission from the authors.
 */

CONTENTS:

1. What is reve?
2/ Changes made in this patch.
3/ How to install this patch.
4/ How to get previous patches.

----------------

1/ What is reve?

Reve is an othello game. It works under SunView, XView, X11 (Xlib) and on
dumb tty terminals.

Reve has nine levels of difficulty. Levels 1-3 should be useful to beginners,
levels 4-6 would satisfy amateurs, and the higher levels will give experts a
good game. Level 8 (30 minutes) is the tournament level.

----------------

2/ Changes made in this patch.

       * Adjusted Makefile.dist to correctly install and shar reve.man and
         reve.man.text.
 
       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         The message "Computer can't play both sides" or words to that
         effect, almost extends into the "Notes" line--not pretty.
         I've moved the notes panel message down below the display message.
         The score and turn messages are below that. This will allow longer
         display messages and evaluation information.

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         From Jacob E. Goodman <JEGCC@CUNYVM.CUNY.EDU>
         The "last move" square was not being removed when a new move was
         made, with the monochrome SunView version.

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         Stick with either "piece" or "stone" when outputting messages. The
         manual pages have been changes to use stone[s].

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         The mechanism for moving (pulling a circle around) is neat, but
         slightly imprecise. How about making the square which is pointed to
         be surrounded by a black box in addition?

       * From Rod Whitby <rwhitby@adl.austek.oz>
         The redefinition of LIBDIR in the Reve Imakefile will override any
         site customisation in site.def in the Imake config directory.

       * From Daniel Edward Lovinger <dl2n+@andrew.cmu.edu>
         Use <X11/Xos.h> in x11.c and xview.c - it makes system transparent
         code a considerable bit easier ... at least in terms of header file
         stuff. In particular, it handles the {strings,string}.h bit
         automagically.

       * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         The -animate command line option has been provided to show animation.
         The computer's stone will glide in from the top left corner of the
         board, and if you hold the left mouse button down, you can drag
         your stone around.

       * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         The -quick command line option have been provided to prevent the
         flash of the turned over stones, and thus provide a quicker game.

       * From Valerie Haecky <vmh@Eng.Sun.COM>
         Showing the last move could be optional. The -last command line
         option has been provided to do this.

       * The -b command line option has been changed to -black.
         The -l command line option has been changed to -load.
         The -n command line option has been changed to -notes.
         The -w command line option has been changed to -white.

       * From Jacob E. Goodman <JEGCC@CUNYVM.CUNY.EDU>
         With the SunView version on a monochrome screen, when I close Reve
         up, the icon is invisible.

      *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         The "Done" button always confuses me, I would have thought "Hide",
         "Iconify" would have been a better label for it.

      *  Incorporated the game Reve game strategy routines from Yves that
         were used in the University of Waterloo Othello competition. These
         should increase the speed, and the quality of the notation of the
         5 stones border. A bug detected on DecStation 5000 has been solved
         too. The note is different for:

            . . o o o o o .        and        . . o o o o o .
            ? ? o ? ? ? ? ?                   ? ? x ? ? ? ? ?

            Bad, because a real               "Good" ( note = 0 ),
            5 stones border.                  because in fact a future
            ( insertion problem )             6 stones border.

      *  To stop Saber-C from bitching, added continue's to all while and
         for loops that had empty bodies.

      *  A call to draw_rect() in draw_textfield() in items.c had an incorrect
         number of parameters.

      *  From John Eldredge <mtxinu!uunet.UU.NET!radar!eldredge@Sun.COM>
         Added in changes to get Reve to compile on an AT&T UNIX PC (also
         known as a 7300 or 3B1). This machine uses version 3.51 of its
         operating system, which is based upon System V Rev. 2.
         In addition to a few SYSV conditional compilations for the #include
         for <sys/times.h>, a new definition has been added to the
         Makefile.dist file, called NO_TIMEVAL which needs to be uncommented,
         since the timeval structure isn't defined under System V. The usleep()
         fix is a real hack; System V (or at least this version) doesn't have
         either the select() system call or the usleep() system call, and can
         only sleep multiples of one second.

       * The keyboard accelerator for "moves?" has been changed from 'A' to
         'M'.

       * Suggest shows an evaluation if Notes are on.

       * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         When you undo a move, I suspect the entire board is redrawn. If you
         keep a separate array of what's actually on-screen, then a take-back
         should only redraw the squares that are different.

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         It shouldn't say "Black to move" or give Notes when game is over.

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         When the human takes a move back, the line to the right, near the
         bottom, saying something like: White: <c-7> eval : 1488
         should change back accordingly.
 
       * The X11 version was incorrectly processing the Shift keys.

       * From Valerie Haecky <vmh@Eng.Sun.COM>
         Instead of the square used to show "last move", you could display the
         move number in the stone. This is nice, if you want to comment a game.
         I just find myself counting stones all the time. I've added the
         -number command line option to do this.

       * From Soren Hein <shein@ferdowsi.berkeley.edu>
         The note function is not so useful when you don't know what "1488"
         means, anyway. Are positive numbers good for White, or do they just
         represent the incremental value of the latest move? Could they be
         meaningfully converted into an equivalent number of pieces?

         [An explanation of how the evaluation value is calculated, has been
          added to the README file, in the strategy section - Rich.]

       * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         From Soren Hein <shein@ferdowsi.berkeley.edu>
         As the computer is making it's move, highlight the best square found
         so far during the computer search and display its rating in the Notes
         section.

       * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
         Fixed up the MANIFEST and FILES files, to use the new names from
         patch #1.

----------------

3/ How to install this patch.

This patch consists of three parts. Save each one first. You should then
use Larry Wall's patch program to apply these changes. Assuming the three
files are called patch2-1, patch2-2 and patch2-3, do the following:

cd reve_src        # directory where your reve source files are.
patch <patch1-1
patch <patch1-2
patch <patch1-3

Copy Makefile.dist to Makefile, and adjust for your site. See the README
file for things you might have to tweak in order to get Reve to work on
your machine.

You will then have to do the appropriate make, to generate the graphics
version you require. Do a "make help" to obtain more information on this.

Finally, you should do a "make install". You will probably have to be
super-user to do this.

If you have any problems with Reve after applying this patch, and your
problem is not listed in the TODO file, please let us know.

----------------

4/ How to get previous patches.

If you need to get patches 1, then this can be obtained from the automatic
mail archive server, by sending a message to rb-archive-server@Aus.Sun.COM
containing the line:
 
send reve patch1
 
where n is the patch number you require.
 
You can also include a path line in these requests to indicate the mail
path that the archive server should use to send the files to you. Such a
path line could be:
 
path uunet.uu.net!hostname!user
 
Note that this is uunet.uu.net and not just uunet. Sun.COM doesn't recognise
just uunet.
 
[NOTE: When unpacking the shars generated by the automatic mail service,
       it is possible you will get error messages for incorrect length.
       Please ignore; hopefully the files should still unpack correctly].
 
Rich Burridge           richb@Aus.Sun.COM
Yves Gallot             galloty@cernvax.cern.ch

------CUT HERE------patch 2 - part 1------CUT HERE------

------- patchlevel.h -------
Prereq: 1
*** /tmp/da02130        Wed Nov 28 11:00:28 1990
--- patchlevel.h        Fri Nov  9 12:42:30 1990
***************
*** 22,25 ****
   *  (see README file), then an attempt will be made to fix them.
   */

! #define  PATCHLEVEL  1
--- 22,25 ----
   *  (see README file), then an attempt will be made to fix them.
   */

! #define  PATCHLEVEL  2

------- CHANGES -------
*** /tmp/da02103	Wed Nov 28 11:00:21 1990
--- CHANGES	Wed Nov 28 10:58:57 1990
***************
*** 23,28 ****
--- 23,167 ----
  Reve change history.
  ====================
  
+ v1.1 - patchlevel 2. 28th November 1990.
+ 
+        * Adjusted Makefile.dist to correctly install and shar reve.man and
+          reve.man.text.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          The message "Computer can't play both sides" or words to that
+          effect, almost extends into the "Notes" line--not pretty.
+          I've moved the notes panel message down below the display message.
+          The score and turn messages are below that. This will allow longer
+          display messages and evaluation information.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          From Jacob E. Goodman <JEGCC@CUNYVM.CUNY.EDU>
+          The "last move" square was not being removed when a new move was
+          made, with the monochrome SunView version.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          Stick with either "piece" or "stone" when outputting messages. The
+          manual pages have been changes to use stone[s].
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          The mechanism for moving (pulling a circle around) is neat, but
+          slightly imprecise. How about making the square which is pointed to
+          be surrounded by a black box in addition?
+ 
+        * From Rod Whitby <rwhitby@adl.austek.oz>
+          The redefinition of LIBDIR in the Reve Imakefile will override any
+          site customisation in site.def in the Imake config directory.
+ 
+        * From Daniel Edward Lovinger <dl2n+@andrew.cmu.edu>
+          Use <X11/Xos.h> in x11.c and xview.c - it makes system transparent
+          code a considerable bit easier ... at least in terms of header file
+          stuff. In particular, it handles the {strings,string}.h bit
+          automagically.
+ 
+        * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          The -animate command line option has been provided to show animation.
+          The computer's stone will glide in from the top left corner of the
+          board, and if you hold the left mouse button down, you can drag
+          your stone around.
+ 
+        * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          The -quick command line option have been provided to prevent the
+          flash of the turned over stones, and thus provide a quicker game.
+ 
+        * From Valerie Haecky <vmh@Eng.Sun.COM>
+          Showing the last move could be optional. The -last command line
+          option has been provided to do this.
+ 
+        * The -b command line option has been changed to -black.
+          The -l command line option has been changed to -load.
+          The -n command line option has been changed to -notes.
+          The -w command line option has been changed to -white.
+ 
+        * From Jacob E. Goodman <JEGCC@CUNYVM.CUNY.EDU>
+          With the SunView version on a monochrome screen, when I close Reve
+          up, the icon is invisible.
+ 
+       *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          The "Done" button always confuses me, I would have thought "Hide",
+          "Iconify" would have been a better label for it.
+ 
+       *  Incorporated the game Reve game strategy routines from Yves that
+          were used in the University of Waterloo Othello competition. These
+          should increase the speed, and the quality of the notation of the
+          5 stones border. A bug detected on DecStation 5000 has been solved
+          too. The note is different for:
+ 
+             . . o o o o o .        and        . . o o o o o .
+             ? ? o ? ? ? ? ?                   ? ? x ? ? ? ? ?
+ 
+             Bad, because a real               "Good" ( note = 0 ),
+             5 stones border.                  because in fact a future
+             ( insertion problem )             6 stones border.
+ 
+       *  To stop Saber-C from bitching, added continue's to all while and
+          for loops that had empty bodies.
+ 
+       *  A call to draw_rect() in draw_textfield() in items.c had an incorrect
+          number of parameters.
+ 
+       *  From John Eldredge <mtxinu!uunet.UU.NET!radar!eldredge@Sun.COM>
+          Added in changes to get Reve to compile on an AT&T UNIX PC (also
+          known as a 7300 or 3B1). This machine uses version 3.51 of its
+          operating system, which is based upon System V Rev. 2.
+          In addition to a few SYSV conditional compilations for the #include
+          for <sys/times.h>, a new definition has been added to the
+          Makefile.dist file, called NO_TIMEVAL which needs to be uncommented,
+          since the timeval structure isn't defined under System V. The usleep()
+          fix is a real hack; System V (or at least this version) doesn't have
+          either the select() system call or the usleep() system call, and can
+          only sleep multiples of one second.
+ 
+        * The keyboard accelerator for "moves?" has been changed from 'A' to
+          'M'.
+ 
+        * Suggest shows an evaluation if Notes are on.
+ 
+        * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          When you undo a move, I suspect the entire board is redrawn. If you
+          keep a separate array of what's actually on-screen, then a take-back
+          should only redraw the squares that are different.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          It shouldn't say "Black to move" or give Notes when game is over.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          When the human takes a move back, the line to the right, near the
+          bottom, saying something like: White: <c-7> eval : 1488
+          should change back accordingly.
+ 
+        * The X11 version was incorrectly processing the Shift keys.
+ 
+        * From Valerie Haecky <vmh@Eng.Sun.COM>
+          Instead of the square used to show "last move", you could display the
+          move number in the stone. This is nice, if you want to comment a game.
+          I just find myself counting stones all the time. I've added the
+          -number command line option to do this.
+ 
+        * From Soren Hein <shein@ferdowsi.berkeley.edu>
+          The note function is not so useful when you don't know what "1488"
+          means, anyway. Are positive numbers good for White, or do they just
+          represent the incremental value of the latest move? Could they be
+          meaningfully converted into an equivalent number of pieces?
+ 
+          [An explanation of how the evaluation value is calculated, has been
+           added to the README file, in the strategy section - Rich.]
+ 
+        * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          From Soren Hein <shein@ferdowsi.berkeley.edu>
+          As the computer is making it's move, highlight the best square found
+          so far during the computer search and display its rating in the Notes
+          section.
+ 
+        * From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+          Fixed up the MANIFEST and FILES files, to use the new names from
+          patch #1.
+ 
  v1.1 - patchlevel 1. 9th November 1990.
  
         * Time allocation function was out by 1. All the levels are shifted

------- Makefile.dist -------
*** /tmp/da02106	Wed Nov 28 11:00:22 1990
--- Makefile.dist	Tue Nov 20 11:19:44 1990
***************
*** 51,56 ****
--- 51,62 ----
  #
  #NO_USLEEP      = -DNO_USLEEP
  #-----------------------------------------------------------------------
+ #  If your machine doesn't have a definition for the timeval struct, then
+ #  you will need to uncomment this definition. It's needed to get Reve to
+ #  work an an AT&T UNIX PC (aka 7300 or 3b1).
+ #
+ #NO_TIMEVAL     = -DNO_TIMEVAL
+ #------------------------------------------------------------------------
  #  If you not running under a BSD4.3 derived system, the parameters
  #  to the select call are different, and this definition should be
  #  uncommented. You need to uncomment this for SunOS v3.x.
***************
*** 94,101 ****
  #
  #  Compilation flags and standard macro definitions.
  #
! CDEFS		= $(NOINDEX) $(NOSELECT) $(NO_USLEEP) $(EDGENAME) $(SELTYPE) \
! 		  $(SIGRET) $(SYSV) $(X11INCDIR) $(XVIEWINCDIR)
  CFLAGS          = -O $(CDEFS)
  #
  #==========================================================================
--- 100,108 ----
  #
  #  Compilation flags and standard macro definitions.
  #
! CDEFS		= $(NOINDEX) $(NOSELECT) $(NO_USLEEP) $(NO_TIMEVAL) \
! 		  $(EDGENAME) $(SELTYPE) $(SIGRET) $(SYSV) \
! 		  $(X11INCDIR) $(XVIEWINCDIR)
  CFLAGS          = -O $(CDEFS)
  #
  #==========================================================================
***************
*** 129,136 ****
  		  $(IDIR)/hglass.cursor \
  		  $(IDIR)/nocur.cursor
  
! OTHERS          = CHANGES README TODO reve.6 MANIFEST FILES \
! 		  reve.man Makefile.dist
  
  SFILES1         = events.c items.c makemove.c main.c procs.c
  SFILES2		= boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
--- 136,143 ----
  		  $(IDIR)/hglass.cursor \
  		  $(IDIR)/nocur.cursor
  
! OTHERS          = CHANGES README TODO reve.man MANIFEST FILES \
! 		  reve.man.text Makefile.dist
  
  SFILES1         = events.c items.c makemove.c main.c procs.c
  SFILES2		= boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
***************
*** 190,196 ****
  		-cat reve.edge1 reve.edge2 > $(ETABLE)
  		-cp $(ETABLE) $(LIBDIR)
  		-chmod 644 $(LIBDIR)/$(ETABLE)
! 		-cp reve.6 $(MANDIR)/reve.$(MANSECT)
  		-chmod 644 $(MANDIR)/reve.$(MANSECT)
  
  clean:;         rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core
--- 197,203 ----
  		-cat reve.edge1 reve.edge2 > $(ETABLE)
  		-cp $(ETABLE) $(LIBDIR)
  		-chmod 644 $(LIBDIR)/$(ETABLE)
! 		-cp reve.man $(MANDIR)/reve.$(MANSECT)
  		-chmod 644 $(MANDIR)/reve.$(MANSECT)
  
  clean:;         rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core

------- README -------
*** /tmp/da02109	Wed Nov 28 11:00:22 1990
--- README	Fri Nov 23 08:07:26 1990
***************
*** 103,108 ****
--- 103,131 ----
               "The Development of a World Class Othello Program", Kai-Fu Lee
               and Sanjoy Mahajan, Art. Int. 43(1990) 21-36.
  
+ Turning Notes on, displays an evaluation for each computer move. This value
+ is calculated as follows:
+ 
+   An edgetable is pre-computed. A value is given to each border configuration.
+   The average is 0, the mean value about 1000.
+ 
+   Then I fix c1 = 312 + 6 * movenumber
+              c2 = | 50 + 2 * movenumber   1 <= movenumber <= 25
+                   | 75 + movenumber      25 <= movenumber <= 60
+              c3 = 99
+   ( Iago implementation constants )
+ 
+   then eval = ( c1 * ( edgesnote + Xsquaresnote ) +
+                 c2 * currentmobility +
+                 c3 * Potentialmobility ) / 1000
+ 
+   mobility = 1000 * ( p - o ) / ( p + o + 2 )
+   where p is the evaluation for the player and o for the opponent
+ 
+   p and o are about in the set [ -10, 10 ]
+ 
+ In short, a positive number is good for the computer, and a negative numvber
+ is good for the opponent.
  
  Here is a listing of a high level Reve vs Reve match.
  

------- TODO -------
*** /tmp/da02112	Wed Nov 28 11:00:23 1990
--- TODO	Wed Nov 28 10:59:04 1990
***************
*** 20,29 ****
   *  (see README file), then an attempt will be made to fix them.
   */
  
  Reve TODO list.
  ===============
  
! 1/ Finish off the X11 "two screens on two machines" version. The hooks are
     all in place, but not enough spare time...
     ~ The cursors in x11.c will need to be allocated for each screen
       separately.
--- 20,43 ----
   *  (see README file), then an attempt will be made to fix them.
   */
  
+ Problems with Reve on various hardware.
+ =======================================
+ 
+ *  From Nick Sayer <mrapple@quack.sac.ca.us>
+    System is a Sun 2/170 running SunOS 4.0, using the TTY version on a
+    TVI-925. Reve makes a mess on so called "magic-cookie" terminals.
+ 
+ *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
+    When compiling rev_ip.c on an HP-UX 9000 Series 300 machine (68020 or
+    68030), the HP-UX 7.0 C compiler crashes out with the following error:
+   
+    C1 internal error in "tuplonges": invalid OREG in recognize_array()
+   
+ 
  Reve TODO list.
  ===============
  
! *  Finish off the X11 "two screens on two machines" version. The hooks are
     all in place, but not enough spare time...
     ~ The cursors in x11.c will need to be allocated for each screen
       separately.
***************
*** 36,52 ****
       screens. There are probably other routines where this should be the case.
     ~ There will be a few other places where certain routines will need to
       output to both displays if dtype is XTWO.
! 
! 2/ Allow the computer to play itself. Currently this option is disabled,
     because of the inability with some of the graphics versions to interrupt
     it, once it's started.
  
! 3/ From Valerie Haecky <vmh@Eng.Sun.COM>
     It might be nice to have an additional button for <help>.
!    It pops up an alert, giving a short summary of the rules
!    and explaining non-obvious things, like how Difficulty is measured.
  
! 4/ There are several problems outstanding with the XView version:
     ~ **IMPORTANT** Need to find some way to disable MS_LEFT whilst the
                     computer is having its move. At the moment, if you press
                     the left mouse button while the computer is doing something,
--- 50,66 ----
       screens. There are probably other routines where this should be the case.
     ~ There will be a few other places where certain routines will need to
       output to both displays if dtype is XTWO.
!  
! *  Allow the computer to play itself. Currently this option is disabled,
     because of the inability with some of the graphics versions to interrupt
     it, once it's started.
  
! *  From Valerie Haecky <vmh@Eng.Sun.COM>
     It might be nice to have an additional button for <help>.
!    It pops up an alert, giving a short summary of the rules and explaining
!    non-obvious things, like how Difficulty is measured.
  
! *  There are several problems outstanding with the XView version:
     ~ **IMPORTANT** Need to find some way to disable MS_LEFT whilst the
                     computer is having its move. At the moment, if you press
                     the left mouse button while the computer is doing something,
***************
*** 67,143 ****
       currently has; whose turn it is to move could be placed in the title
       line, and panel messages such as invalid move could be written to the
       footer.
  
! 5/ There appears to be a bug with the X11 implementation on an IBM RS6000.
!    When the computer moves a piece from the upper-left border to its place,
!    a "trace" appears along its path. The color of this trace is the color of
!    the background of the screen.
! 
! 6/ Need to allow options like -scale through on the command line. This can
     be done by have an init_graphics() routine that gets called right at
     the start, which strips off graphics specific options.
  
! 7/ Need to add in the ability to show the last move, and show all moves to
     the tty version.
  
! 8/ From Valerie Haecky <vmh@Eng.Sun.COM>
     Display the time left for the user[s] and computer.
  
! 9/ From Valerie Haecky <vmh@Eng.Sun.COM>
!    Showing the last move could be optional.
  
! 10/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     ~ Provide an option or button to toggle the animation of the computer
!       piece from the top-left corner onto the board. On slow workstations,
!       this is embarrassingly flickery and quite distracting.
  
!     ~ Ditto for the flash of the turned over pieces - it slows down the game
!       when you just want a quick game.
! 
!     ~ Add the ability to change the default background colour of the board to
!       a (not too bright !) green colour. After all, that's the colour of the
!       othello sets you buy in the shops!
   
!     [I'll do these with settable resources. I'll allow you to set some of
!      them on the command line, and I'll add a .reverc file, which will be read
!      from the users home directory. For the X11/XView versions, I'll allow the
!      resources to be set in all the standard X places, and the .reverc file can
!      superceed them - Rich.]
  
! 11/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     Supply a way of forcing the computer to move before its search is complete.
!     This would be very handy at the higher levels.
  
! 12/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     Allow the player to go forwards through a game as well as backwards (Undo
!     only performs the latter and not the former). In other words, "undo the
!     Undo" !
  
! 13/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     As the computer is making it's move, highlight the best square found so
!     far during the computer search and display its rating in the Notes section.
  
! 14/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     What about a 'Play Next Best' option? This would undo the last computer
!     move and play the second best move found rather than the best one. If
!     selected again, there would be another undo and the third best move would
!     be made instead and so on, until the move list is exhausted. It's great
!     for trying out different moves in the same position.
  
! 15/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     Countdown clocks for blitz games (first to hit 00:00:00 loses if the game
!     is still in progress).
  
! 16/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     Board editing.
  
! 17/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     A display of the full tree for the best move rather than just the best
!     move itself.
  
! 18/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     A resign feature if the search shows a completely lost endgame.
  
! 19/ From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!     A 'I will win/lose in x moves' announcement if a forced win/loss is
!     detected.
--- 81,298 ----
       currently has; whose turn it is to move could be placed in the title
       line, and panel messages such as invalid move could be written to the
       footer.
+    ~ It should be possible to start a load/save by just typing Return in the
+      Load/Save popup.
  
! *  Need to allow options like -scale through on the command line. This can
     be done by have an init_graphics() routine that gets called right at
     the start, which strips off graphics specific options.
  
! *  Need to add in the ability to show the last move, and show all moves to
     the tty version.
  
! *  From Valerie Haecky <vmh@Eng.Sun.COM>
     Display the time left for the user[s] and computer.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Add the ability to change the default background colour of the board to
!    a (not too bright !) green colour. After all, that's the colour of the
!    othello sets you buy in the shops!
!  
!    [I'll do these with settable resources. I'll allow you to set some of
!     them on the command line, and I'll add a .reverc file, which will be read
!     from the users home directory. For the X11/XView versions, I'll allow the
!     resources to be set in all the standard X places, and the .reverc file can
!     superceed them - Rich.]
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Supply a way of forcing the computer to move before its search is complete.
!    This would be very handy at the higher levels.
  
!    If we can actually see what moves have been though about so far, then you
!    may no longer be left in the dark as to what the computer is doing (you can
!    manually stop it thinking when it finds a really strong move for example).
!    As an afterthought, I realised that it would be nice to know what ply
!    level the search is currently up to.
   
!    An even neater trick would be to number each square with its position in
!    the best move list. You could either show this at the end of each ply or
!    update in real-time (in which case, the numbered squares would need to be
!    cleared when the ply search is deepened to avoid confusion - also some
!    on-screen renumbering would have to be done on-the-fly).
!  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Allow the player to go forwards through a game as well as backwards (Undo
!    only performs the latter and not the former). In other words, "undo the
!    Undo" !
  
!    "New Game" should just undo the game right back to the start. That way
!    a player can use the move forwards facility to replay the game easily
!    right from the start. Of course, as soon as the player makes a new move,
!    then s/he won't be able to replay the game any further.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Countdown clocks for blitz games (first to hit 00:00:00 loses if the game
!    is still in progress).
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    From Valerie Haecky <vmh@Eng.Sun.COM>
!    Board editing. A 'setup' mode, where you can place stones on the board
!    (NOT moves). This is good for game analysis, puzzles, starting from a
!    specific opening (like Reve always plays perpendicular, and no-one knows
!    whether this is best, and it would be nice to set up other openings).
!    It has to be stones, not moves, because puzzles don't always contain legal
!    positions, and transcripts have bugs.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    A 'I will win/lose in x moves' announcement if a forced win/loss is
!    detected.
  
! *  From Valerie Haecky <vmh@Eng.Sun.COM>
!    With the XView version, when you change the Black/White setting in the
!    buttons, the default in the menu should change, too.
!    Or: if the default in the menu stays the same, if you } hit the new menu
!    button, and ask for the default, the buttons should update to reflect this.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    When you click on Quit and have actually made some moves/changes, then
!    it would be nice to have a dialogue box pop up to say "Save game before
!    Quitting ?" with Yes, No and Cancel buttons in the box. Perhaps this could
!    be part of a .reverc/.Xresources setting, because some people might not
!    like the intrusion. This should probably apply to the "New Game" button
!    too come to think of it ("Save game before Restarting ?" in this case).
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Display the number of board positions searched so far. The frequency of
!    update is up to taste really - perhaps when the best move found is
!    updated. Tied in with this, you could give a "positions searched per
!    second" rating when the computer finishes its search and makes its move.
!    This would be a great measure of the speed of the machine/algorithm.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Allow the level to be explicitly set in seconds per move (or perhaps
!    minutes per game as it currently is) rather than having a fixed set of
!    levels. The highest playing level could be called "Infinite" rather than
!    "Tournament" and just plays until interrupted or the game end is detected.
  
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Implement an "Equality" play mode which matches the computer playing time
!    exactly with the human's.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Have a 3-D board option. It'd sure look great. You just need to angle the
!    edges inward from bottom to top and draw elipses rather than circles.
!    Taking this further, you come show a wood grained board, and a light
!    source up above for ray shaded stones.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    If you intend to implement on-screen clocks (hopefully in HH:MM:SS
!    format), then have options to reset them to zero at any time and also
!    to stop them (effectively a "Pause" mode) - perhaps that could be tied
!    in with iconification. Perhaps another option (or resource to decide
!    whether the clocks should be analog or digital).
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Show the four "blobs" at the edges of the four central squares (top-left
!    of d4, top-right of d5, bottom-left of e4 and bottom-right of e5). No,
!    I don't know why they're there on commercial Othello boards in the first
!    place, except perhaps to mark the starting positions.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Have some annoyingly intrusive comments during the game :-) Examples
!    could be: "That was a really bad move", "I'm crushing you", "This
!    position is boring", "Hurry up and make your move !" etc. etc.
! 
!    [Othello2, the predecesor of the graphics used in Reve, and posted to
!     comp.sources.games last year, used to have this ability - Rich.]
! 
! *  From Robert Cohen <robert@anucsd.anu.oz.au>
!    If you play black and as your first move you go either e6 or f5 and then
!    ask for a suggestion, the suggestion is a1 which is of course an illegal
!    move. This appears to be independent of level chosen.
! 
! *  Try to get online copies of the two paper referenced in the README file.
!    Otherwise, add more comments to the computer strategy code.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Allow the board to be rotated 90 degrees. The movelist will also have
!    to be adjusted of course.
! 
! *  Add in the ability for the Reve window[s] to be totally resized. This
!    would involve the black and white stone offscreen images being
!    generated "on-the-fly". Two things to note:
! 
!    a) The resize must be forced to be square in dimensions. This avoids very
!       strange-looking elliptical pieces.
! 
!    b) The dimensions should be a multiple of 8, otherwise there will be some
!       funny sub-dimensions for border, square and piece sizes.
! 
! *  From Soren Hein <shein@ferdowsi.berkeley.edu>
!    Reve currently can't refresh the screen when the computer is making a
!    move.
! 
! *  From Soren Hein <shein@ferdowsi.berkeley.edu>
!    Why double switches for White, Black and Notes? Both halves of the
!    switches do the same thing.
! 
! *  From Soren Hein <shein@ferdowsi.berkeley.edu>
!    Possible to give some strength indication of the levels? Maybe by
!    analogy with chess ratings, if you're familiar enough with Elo-ratings
!    to make guesses/comparisons.
! 
! *  From Soren Hein <shein@ferdowsi.berkeley.edu>
!    There should be symmetry between the case when the human can't move
!    and when there is only one move for them. Yet in one case the program just
!    goes on, and in the other, it waits for the only move. I would like to
!    give my OK to forfeit before the program takes its next move.
! 
! *  From Dan Bernstein <brnstnd@KRAMDEN.ACF.NYU.EDU>
!    An idea which can possibly be incorporated:
! 
!    Along with each board keep two arrays size 100 (it's easier on the code
!    to use artifical borders) of bytes. Each byte has a bit set if a player
!    can take from that spot in the direction numbered by the bit. This turns
!    out to be reasonably easy to maintain with the moves, and it makes legal
!    move checks and actual flips so fast that the program runs about three
!    times faster overall.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    It would be nice to have the ability to "make tty" in the Imakefile as
!    well as being able to generate the X11 version.
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    Add in a move list window, which would contain a scrollable list of all
!    the moves so far (plus evaluation for the computers moves).
! 
! 
! Items we're unlikely to implement.
! ==================================
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    From Soren Hein <shein@ferdowsi.berkeley.edu>
!    What about a 'Play Next Best' option? This would undo the last computer
!    move and play the second best move found rather than the best one. If
!    selected again, there would be another undo and the third best move would
!    be made instead and so on, until the move list is exhausted. It's great
!    for trying out different moves in the same position.
!  
!    [There is currently no ordering move list, because a search can be stopped
!     by the alarm. Then the move list is only 1 or 2 moves length - Yves.]
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    A display of the full tree for the best move rather than just the best
!    move itself.
! 
!    [In my algorithm, it is impossible to have it. How do want to know, when
!     you are in the tree, that it will be the best move ? And when you know it,
!     it is impossible to know where you were in the tree - Yves.]
! 
! *  From Richard K. Lloyd <RKL@anduin.compsci.liverpool.ac.uk>
!    A resign feature if the search shows a completely lost endgame.
! 
!    [Othello is not chess. The result is the disks differential, not win,
!     tie or loss. And I don't know if it is a "completely lost endgame". I
!     only know that if the opponent is perfect, then I will lose. A human
!     player that should win at move 46 and doesn't use undo, can very easily
!     lose - Yves.]

------- boardstuff.c -------
*** /tmp/da02115	Wed Nov 28 11:00:24 1990
--- boardstuff.c	Wed Nov 28 10:35:13 1990
***************
*** 27,33 ****
--- 27,37 ----
  #include "color.h"
  #include "extern.h"
  #include <ctype.h>
+ #ifdef SYSV
+ #include <sys/times.h>
+ #else
  #include <sys/time.h>
+ #endif /*SYSV*/
  
  #ifdef X11
  #include <X11/Xos.h>
***************
*** 179,190 ****
    taken = formfliplist(move, player) ;
    update_board_image(player) ;
    SPRINTF(line, "%s took %d %s", (player == BLACK) ? "Black" : "White",
!                           taken, (taken  == 1)     ? "piece" : "pieces") ;
    message(PANEL_MES, line) ;
  }
  
  
  void
  draw_piece(piece, x, y, op)    /* Draw an othello piece on the board. */
  int piece, x, y ;
  enum optype op ;
--- 183,204 ----
    taken = formfliplist(move, player) ;
    update_board_image(player) ;
    SPRINTF(line, "%s took %d %s", (player == BLACK) ? "Black" : "White",
!                           taken, (taken  == 1)     ? "stone" : "stones") ;
    message(PANEL_MES, line) ;
  }
  
  
  void
+ draw_outline(move, state)
+ int move ;
+ enum bltype state ;
+ {
+   if (last_outline == -1) return ;
+   draw_square(move, state, 1) ;
+ }
+ 
+ 
+ void
  draw_piece(piece, x, y, op)    /* Draw an othello piece on the board. */
  int piece, x, y ;
  enum optype op ;
***************
*** 202,208 ****
   
  void
  draw_rect(x1, y1, x2, y2, op, color)
! int x1, y1, x2, y2, op, color ;
  {
    draw_line(x1, y1, x2, y1, op, color) ;
    draw_line(x1, y1, x1, y2, op, color) ;
--- 216,223 ----
   
  void
  draw_rect(x1, y1, x2, y2, op, color)
! int x1, y1, x2, y2, color ;
! enum optype op ;
  {
    draw_line(x1, y1, x2, y1, op, color) ;
    draw_line(x1, y1, x1, y2, op, color) ;
***************
*** 211,216 ****
--- 226,248 ----
  }
  
  
+ void
+ draw_square(move, state, offset)
+ int move, offset ;
+ enum bltype state ;
+ {
+   int color, x, y ;
+ 
+   if (iscolor[(int) cur_dpyno]) color = (state == IS_ON) ? C_BLACK : C_LBROWN ;
+   else                          color = (state == IS_ON) ? C_BLACK : C_WHITE ;
+ 
+   x = (move & 7)  * CELL_SIZE + BBORDER ;
+   y = (move >> 3) * CELL_SIZE + BBORDER ;
+   draw_rect(x + offset,             CY + y + offset,
+             x + CELL_SIZE - offset, CY + y + CELL_SIZE - offset, RSRC, color) ;
+ }
+ 
+ 
  formfliplist(move, player)
  int move, player ;
  {        
***************
*** 429,434 ****
--- 461,478 ----
  
  
  void
+ set_eval(player, move, note)
+ int player, move ;
+ long note ;
+ {
+   SPRINTF(line, "%s: <%c-%c> eval : %ld",
+           (player == BLACK) ? "Black" : "White",
+           (move & 7) + 'a', (move >> 3) + '1', note) ;
+   message(EVAL_MES, line) ;
+ }
+ 
+ 
+ void
  set_score()
  {
    SPRINTF(line, "Stones: Black: %2d  White: %2d",
***************
*** 505,524 ****
  
  
  void
  show_last(move, state)
  int move ;
  enum bltype state ;
  {
!   int color, x, y ;
  
-   if (move == -1) return ;
-   if (iscolor[(int) cur_dpyno]) color = (state == IS_ON) ? C_BLACK : C_LBROWN ;
-   else                          color = (state == IS_ON) ? C_BLACK : C_WHITE ;
  
!   x = (move & 7)  * CELL_SIZE + BBORDER ;
!   y = (move >> 3) * CELL_SIZE + BBORDER ;
!   draw_rect(x + 2,             CY + y + 2,
!             x + CELL_SIZE - 2, CY + y + CELL_SIZE - 2, RSRC, color) ;
  }
  
  
--- 549,603 ----
  
  
  void
+ show_best(move, note)
+ int move ;
+ long note ;
+ {
+   batch(IS_ON) ;
+   if (move == -1 || do_bestmove == FALSE) return ;
+   if (best_cmove != -1)
+     draw_square(best_cmove, IS_OFF, 2) ;
+   best_cmove = move ;
+   draw_square(best_cmove, IS_ON, 2) ;
+   if (show_notes) set_eval(next_player, move, note) ;
+   batch(IS_OFF) ;
+ }
+ 
+ 
+ void
  show_last(move, state)
  int move ;
  enum bltype state ;
  {
!   if (move == -1 || do_last == FALSE) return ;
!   draw_square(move, state, 2) ;
! }
  
  
! void
! show_number(move, state)
! int move ;
! enum bltype state ;
! {
!   char num[3] ;
!   int color, strw, val, x, y ;
! 
!   if (move == -1 || do_number == FALSE) return ;
!   if (board.square[move] == BLACK)
!     color = (state == IS_ON) ? C_WHITE : C_BLACK ;
!   else if (board.square[move] == WHITE)
!     color = (state == IS_ON) ? C_BLACK : C_WHITE ;
!   x = (move & 7)  * CELL_SIZE + BBORDER + PIECE_MARGIN ;
!   y = (move >> 3) * CELL_SIZE + BBORDER + PIECE_MARGIN ;
! 
!   val = 60 - board.moves_left ;
!   if (state == IS_OFF) val-- ;
!   SPRINTF(num, "%2d", val) ;
!   strw = get_strwidth(NFONT, num) ;
! 
!   x = x + ((2 * PIECE_RAD) - strw) / 2 ;
!   y = y + CY + nfont_height + ((2 * PIECE_RAD) - nfont_height) / 2 ;
!   draw_text(x, y, NFONT, color, num) ;
  }
  
  
***************
*** 545,556 ****
  update_board_image(player)
  int player ;
  {
!   int flips, i, piece, x, y ;
   
    show_all(IS_OFF) ;
    show_last(last_move, IS_OFF) ;
    show_suggestion() ;
!   for (flips = 0; flips < 4; flips++)
      {
        batch(IS_ON) ;
        FOR_BOARD(i)
--- 624,637 ----
  update_board_image(player)
  int player ;
  {
!   int flips, i, piece, total_flips, x, y ;
   
+   total_flips = (quickgame == TRUE) ? 2 : 4 ;
    show_all(IS_OFF) ;
    show_last(last_move, IS_OFF) ;
+   show_number(last_move, IS_OFF) ;
    show_suggestion() ;
!   for (flips = 0; flips < total_flips; flips++)
      {
        batch(IS_ON) ;
        FOR_BOARD(i)
***************
*** 568,573 ****
--- 649,655 ----
        PAUSE ;
      }
    show_last(move, IS_ON) ;
+   show_number(move, IS_ON) ;
    last_move = move ;
    set_score() ;
    set_turn(OPPONENT(player)) ;
***************
*** 575,586 ****
    if (show_notes)
      if ((player == BLACK && items[(int) BLACK_PLAYS].value == COMPUTER) ||
          (player == WHITE && items[(int) WHITE_PLAYS].value == COMPUTER))
!       {
!         SPRINTF(line, "%s: <%c-%c> eval : %ld",
!                 (player == BLACK) ? "Black" : "White",
!                 (move & 7) + 'a', (move >> 3) + '1', note) ;
!         message(EVAL_MES, line) ;
!       }
  }
  
  
--- 657,663 ----
    if (show_notes)
      if ((player == BLACK && items[(int) BLACK_PLAYS].value == COMPUTER) ||
          (player == WHITE && items[(int) WHITE_PLAYS].value == COMPUTER))
!       set_eval(player, move, note) ;
  }
  
  
***************
*** 606,609 ****
--- 683,688 ----
        SPRINTF(line, "Black wins %d-%d", cs, ps) ;
        message(SCORE_MES, line) ;
      }
+   message(TURN_MES, "") ;
+   message(EVAL_MES, "") ;
  }

------- events.c -------
*** /tmp/da02118	Wed Nov 28 11:00:25 1990
--- events.c	Thu Nov 22 11:16:40 1990
***************
*** 127,143 ****
  void
  do_action()
  {
    switch (nextc)
      {
!       case MOUSE_MOVING : draw_piece(next_player, piece_x, piece_y, RINV) ;
                            piece_x = curx - PIECE_RAD ;
                            piece_y = cury - PIECE_RAD ;
!                           draw_piece(next_player, piece_x, piece_y, RINV) ;
                            break ;
                            
        case ENTER_WINDOW : 
        case EXIT_WINDOW  : set_cursor(CANVASCUR) ;
!                           draw_piece(next_player, piece_x, piece_y, RINV) ;
                            cmode = (enum cantype) ((int) cmode - 1) ;
                            break ;
                            
--- 127,164 ----
  void
  do_action()
  {
+   int cx, cy, thismove ;
+ 
    switch (nextc)
      {
!       case MOUSE_MOVING : if (animation == TRUE)
!                             draw_piece(next_player, piece_x, piece_y, RINV) ;
                            piece_x = curx - PIECE_RAD ;
                            piece_y = cury - PIECE_RAD ;
! 
!                           cx = (piece_x + PIECE_RAD    - BBORDER) / CELL_SIZE ;
!                           cy = (piece_y + PIECE_RAD-CY - BBORDER) / CELL_SIZE ;
! 
!                           if (cx >= 0 && cy >= 0 && cx < 8 && cy < 8)
!                             {
!                               thismove = cy * BOARD_SIZE + cx ;
! 
!                               if (thismove != last_outline)
!                                 draw_outline(last_outline, IS_OFF) ;
!                               last_outline = thismove ;
!                               draw_outline(last_outline, IS_ON) ;
!                             }
! 
!                           if (animation == TRUE)
!                             draw_piece(next_player, piece_x, piece_y, RINV) ;
                            break ;
                            
        case ENTER_WINDOW : 
        case EXIT_WINDOW  : set_cursor(CANVASCUR) ;
!                           draw_outline(last_outline, IS_OFF) ;
!                           last_outline = -1 ;
!                           if (animation == TRUE)
!                             draw_piece(next_player, piece_x, piece_y, RINV) ;
                            cmode = (enum cantype) ((int) cmode - 1) ;
                            break ;
                            
***************
*** 253,259 ****
                                set_cursor(NOCURSOR) ;
                                piece_x = curx - PIECE_RAD ;
                                piece_y = cury - PIECE_RAD ;
!                               draw_piece(next_player, piece_x, piece_y, RINV) ;
                                cmode = (enum cantype) ((int) cmode + 1) ;
                              }
                            break ;
--- 274,282 ----
                                set_cursor(NOCURSOR) ;
                                piece_x = curx - PIECE_RAD ;
                                piece_y = cury - PIECE_RAD ;
!                               if (animation == TRUE)
!                                 draw_piece(next_player,
!                                            piece_x, piece_y, RINV) ;
                                cmode = (enum cantype) ((int) cmode + 1) ;
                              }
                            break ;
***************
*** 323,329 ****
        case 'W' : do_cycle_key(WHITE_PLAYS, nextc) ;
                   break ;
  
!       case 'A' : show_all_moves() ;                    /* Button items. */
                   break ;
        case 'L' : curx = 0 ;
                   draw_textfield() ;
--- 346,352 ----
        case 'W' : do_cycle_key(WHITE_PLAYS, nextc) ;
                   break ;
  
!       case 'M' : show_all_moves() ;                    /* Button items. */
                   break ;
        case 'L' : curx = 0 ;
                   draw_textfield() ;

------- extern.h -------
*** /tmp/da02121	Wed Nov 28 11:00:26 1990
--- extern.h	Fri Nov 23 08:27:39 1990
***************
*** 22,27 ****
--- 22,29 ----
   *  (see README file), then an attempt will be made to fix them.
   */
  
+ extern int animation ;     /* If set, show computer glide and piece drag. */
+ extern int best_cmove ;    /* Best computer move so far. */
  extern int bfont_height ;  /* Height in pixels for bold font. */
  extern int but_inverted ;  /* Value of panel item inverted. */
  extern int color ;         /* Current color value. */
***************
*** 28,33 ****
--- 30,38 ----
  extern int cur_ch ;        /* Current character pressed. */
  extern int curx ;          /* Current mouse X position. */
  extern int cury ;          /* Current mouse Y position. */
+ extern int do_bestmove ;   /* If set, continuously update best move. */
+ extern int do_last ;       /* If set, don't show last move. */
+ extern int do_number ;     /* If set, the last stone placed is numbered. */
  extern int down ;          /* Indicates is a mouse button is down. */
  extern int first_move ;    /* Set if computer plays first move. */
  extern int iconic ;        /* Start as an icon if set. */
***************
*** 38,43 ****
--- 43,49 ----
  extern int ix ;            /* Initial X position of the icon. */
  extern int iy ;            /* Initial Y position of the icon. */
  extern int last_move ;     /* Last valid computer move. */
+ extern int last_outline ;  /* Position of last piece whilst dragging. */
  extern int level ;         /* Current difficulty level for computer moves. */
  extern int loadgame ;      /* Set if there is a game file to load. */
  extern int lsval ;         /* Set to 'l' or 's', if loading or saving. */
***************
*** 51,56 ****
--- 57,63 ----
  extern int piece_y ;       /* Current Y position of moving piece */
  extern int play_computer ; /* Set if playing against the computer. */
  extern int posspec ;       /* Set if -Wp or -g option is present (for X11) */
+ extern int quickgame ;     /* If set, don't flash turning stones. */
  extern int s_flip ;
  extern int s_move ;
  extern int s_opponent ;

------- items.c -------
*** /tmp/da02124	Wed Nov 28 11:00:26 1990
--- items.c	Thu Nov 22 11:13:56 1990
***************
*** 133,139 ****
    ty = BBORDER + BHEIGHT + BGAP ;
    tw = (BWIDTH / 2) - 10 + (2 * (BWIDTH + BGAP)) ;
    th = BHEIGHT ;
!   draw_rect(tx, ty, tx + tw, ty + th) ;
    draw_filename(gamefile) ;
  
    tinput = 1 ;
--- 133,139 ----
    ty = BBORDER + BHEIGHT + BGAP ;
    tw = (BWIDTH / 2) - 10 + (2 * (BWIDTH + BGAP)) ;
    th = BHEIGHT ;
!   draw_rect(tx, ty, tx + tw, ty + th, RSRC, C_BLACK) ;
    draw_filename(gamefile) ;
  
    tinput = 1 ;

richb@sunaus.oz (Rich Burridge) (11/28/90)

------CUT HERE------patch 2 - part 2------CUT HERE------

------- main.c -------
*** /tmp/da02127	Wed Nov 28 11:00:27 1990
--- main.c	Wed Nov 28 10:40:26 1990
***************
*** 27,40 ****
  #include "patchlevel.h"
  #ifdef SYSV
  #include <string.h>
  #else
  #include <strings.h>
- #endif /*SYSV*/
  #include <sys/time.h>
  #ifdef X11
  #include <X11/Xos.h>
  #endif /*X11*/
  
  /* Text values for the cyclic buttons. */
  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  char *notes_values[] = { "off", "on", NULL } ;
--- 27,49 ----
  #include "patchlevel.h"
  #ifdef SYSV
  #include <string.h>
+ #include <sys/times.h>
  #else
  #include <strings.h>
  #include <sys/time.h>
+ #endif /*SYSV*/
+ 
  #ifdef X11
  #include <X11/Xos.h>
  #endif /*X11*/
  
+ #ifdef NO_TIMEVAL
+ struct timeval {
+   long tv_sec ;         /* Seconds */
+   long tv_usec ;        /* Microseconds */
+ } ;
+ #endif /*NO_TIMEVAL*/
+ 
  /* Text values for the cyclic buttons. */
  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  char *notes_values[] = { "off", "on", NULL } ;
***************
*** 50,55 ****
--- 59,66 ----
  int piece_x ;           /* Current X position of moving piece. */
  int piece_y ;           /* Current Y position of moving piece */
  
+ int animation ;         /* If set, show computer move glide and piece drag. */
+ int best_cmove ;        /* Best computer move so far. */
  int bfont_height ;      /* Height in pixels for bold font. */
  int but_inverted ;      /* Value of panel item inverted. */
  int color ;             /* Current color value. */
***************
*** 56,61 ****
--- 67,75 ----
  int cur_ch ;            /* Current character pressed. */
  int curx ;              /* Current mouse X position. */
  int cury ;              /* Current mouse Y position. */
+ int do_bestmove ;       /* If set, continuously update computers best move. */
+ int do_last ;           /* If set, don't show last move. */
+ int do_number ;         /* If set, the last stone placed is numbered. */
  int down ;              /* Indicates is a mouse button is down. */
  int first_move = 0 ;    /* Set if computer plays first move. */
  int iconic ;            /* Set if window is currently iconic. */
***************
*** 68,73 ****
--- 82,88 ----
  int ix ;                /* Initial X position of the icon. */
  int iy ;                /* Initial Y position of the icon. */
  int last_move ;         /* Last valid computer move. */
+ int last_outline ;      /* Position of last piece outline whilst dragging. */
  int level ;             /* Current level of difficulty for computer moves. */
  int loadgame = 0 ;      /* Set if there is a game file to load. */
  int lsval = 0 ;         /* Set to 'l' or 's', if loading or saving. */
***************
*** 79,86 ****
  int nfont_height ;      /* Height in pixels for normal font. */
  int play_computer ;     /* Set if playing against the computer. */
  int posspec ;           /* Set if -Wp or -g option is present (for X11) */
  int saveres = 0 ;       /* If set, save computer results to log file. */
! int show_moves = 0 ;    /* If set, all possible moves are being shown. */
  int show_notes ;        /* If set, display notes value from play_reve. */
  int suggestion = -1 ;   /* Positive if a suggested move. */
  int suggest_x ;         /* X position of suggested move. */
--- 94,102 ----
  int nfont_height ;      /* Height in pixels for normal font. */
  int play_computer ;     /* Set if playing against the computer. */
  int posspec ;           /* Set if -Wp or -g option is present (for X11) */
+ int quickgame ;         /* If set, don't flash turning stones. */
  int saveres = 0 ;       /* If set, save computer results to log file. */
! int show_moves ;        /* If set, all possible moves are being shown. */
  int show_notes ;        /* If set, display notes value from play_reve. */
  int suggestion = -1 ;   /* Positive if a suggested move. */
  int suggest_x ;         /* X position of suggested move. */
***************
*** 134,140 ****
               BWIDTH, BHEIGHT, "undo",     0, undo },
  
  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (1*(BHEIGHT+BGAP)),
!              BWIDTH, BHEIGHT, "done",     0, done },
  
  { P_BUTTON,  -1,                          -1,   /* Not normally active. */
               BWIDTH, BHEIGHT, "cancel",  0, remove_textfield },
--- 150,156 ----
               BWIDTH, BHEIGHT, "undo",     0, undo },
  
  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (1*(BHEIGHT+BGAP)),
!              BWIDTH, BHEIGHT, "iconify",  0, done },
  
  { P_BUTTON,  -1,                          -1,   /* Not normally active. */
               BWIDTH, BHEIGHT, "cancel",  0, remove_textfield },
***************
*** 157,169 ****
  { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
               0, 0, "Use left mouse button to move", 0, NULL },
  
! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
               0, 0, "",                                   0, NULL },
  
! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
               0, 0, "White:  2, Black:  2",               0, NULL },
  
! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
               0, 0, "",                                   0, NULL },
  } ;
  
--- 173,185 ----
  { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
               0, 0, "Use left mouse button to move", 0, NULL },
  
! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
               0, 0, "",                                   0, NULL },
  
! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (6*(BHEIGHT+BGAP)),
               0, 0, "White:  2, Black:  2",               0, NULL },
  
! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (6*(BHEIGHT+BGAP)),
               0, 0, "",                                   0, NULL },
  } ;
  
***************
*** 248,258 ****
        if (argv[0][0] == '-')
          switch (argv[0][1])
            {
!             case 'b' : isblack = 1 ;
!                        if (*(argv+1) != NULL && argv[1][0] != '-')
                           {
!                            INC ;
!                            black_dpy = *argv ;
                           }
                         break ;
              case 'c' : play_computer = 1 ;    /* Play against the computer. */
--- 264,281 ----
        if (argv[0][0] == '-')
          switch (argv[0][1])
            {
!             case 'a' : /* Allow computer glide and piece dragging. */
!                        if (EQUAL(argv[0], "-animate")) animation = TRUE ;
!                        break ;
!             case 'b' : if (EQUAL(argv[0], "-bestmove")) do_bestmove = TRUE ;
!                        else if (EQUAL(argv[0], "-black"))
                           {
!                            isblack = 1 ;
!                            if (*(argv+1) != NULL && argv[1][0] != '-')
!                              {
!                                INC ;
!                                black_dpy = *argv ;
!                              }
                           }
                         break ;
              case 'c' : play_computer = 1 ;    /* Play against the computer. */
***************
*** 272,297 ****
                         break ;
              case 'i' : inv_video = 1 ;       /* Display in inverse video. */
                         break ;
!             case 'l' : INC ;                 /* Reve game file to load. */
!                        getparam(gamefile, argv, "-l needs a game file") ;
!                        loadgame = 1 ;        /* Game file to load. */
                         break ;
              case 'm' : monochrome = 1 ;      /* Force display to mono. */
                         for (i = 0; i < MAXDPY; i++) iscolor[i] = 0 ;
                         break ;
!             case 'n' : show_notes = 1 ;      /* Display computer notes. */
!                        items[(int) NOTES].value = 1 ;
                         break ;
              case 'r' : saveres = 1 ;       /* Save computer results to file. */
                         break ;
              case '?' :
              case 'v' : usage() ;
  
!             case 'w' : iswhite = 1 ;
!                        if (*(argv+1) != NULL && argv[1][0] != '-')
                           {
!                            INC ;
!                            white_dpy = *argv ;
                           }
                         break ;
  
--- 295,333 ----
                         break ;
              case 'i' : inv_video = 1 ;       /* Display in inverse video. */
                         break ;
!             case 'l' :      if (EQUAL(argv[0], "-last")) do_last = TRUE ;
!                        else if (EQUAL(argv[0], "-load"))
!                          {
!                            INC ;             /* Reve game file to load. */
!                            getparam(gamefile, argv, "-l needs a game file") ;
!                            loadgame = 1 ;        /* Game file to load. */
!                          }
                         break ;
              case 'm' : monochrome = 1 ;      /* Force display to mono. */
                         for (i = 0; i < MAXDPY; i++) iscolor[i] = 0 ;
                         break ;
!             case 'n' : if (EQUAL(argv[0], "-notes"))
!                          {
!                            show_notes = TRUE ;
!                            items[(int) NOTES].value = 1 ;
!                          }
!                        else if (EQUAL(argv[0], "-number")) do_number = TRUE ;
                         break ;
+             case 'q' : if (EQUAL(argv[0], "-quick")) quickgame = TRUE ;
+                        break ;
              case 'r' : saveres = 1 ;       /* Save computer results to file. */
                         break ;
              case '?' :
              case 'v' : usage() ;
  
!             case 'w' : if (EQUAL(argv[0], "-white"))
                           {
!                            iswhite = 1 ;
!                            if (*(argv+1) != NULL && argv[1][0] != '-')
!                              {
!                                INC ;
!                                white_dpy = *argv ;
!                              }
                           }
                         break ;
  
***************
*** 417,422 ****
--- 453,459 ----
      }
    batch(IS_OFF) ;
    show_last(last_move, IS_ON) ;
+   show_number(last_move, IS_ON) ;
    show_suggestion() ;
    batch(IS_ON) ;
    FOR_BOARD(i)
***************
*** 451,460 ****
--- 488,505 ----
    play_computer = 1 ;                 /* Default is human vs computer. */
    iconic        = 0 ;                 /* Initially an open window. */
    last_move     = -1 ;
+   last_outline  = -1 ;
    next_player   = BLACK ;
+   animation     = FALSE ;
+   best_cmove    = -1 ;
    but_inverted  = -1 ;
+   do_bestmove   = FALSE ;
+   do_last       = FALSE ;
+   do_number     = FALSE ;
+   quickgame     = FALSE ;
    validkey      = 0 ;
    cmode         = BLACK_START ;
+   show_moves    = FALSE ;
    show_notes    = FALSE ;
    isblack       = 0 ;
    iswhite       = 0 ;
***************
*** 463,469 ****
  
    black_dpy = NULL ;              /* X11 black piece display information. */
    white_dpy = NULL ;              /* X11 white piece display information. */
!   STRCPY(geometry,  "") ;         /* X11 geometry information. */
    STRCPY(edgefile, EDGENAME) ;
  }
  
--- 508,515 ----
  
    black_dpy = NULL ;              /* X11 black piece display information. */
    white_dpy = NULL ;              /* X11 white piece display information. */
!   STRCPY(geometry[(int) DPY1], "") ;    /* X11 geometry information. */
!   STRCPY(geometry[(int) DPY2], "") ;
    STRCPY(edgefile, EDGENAME) ;
  }
  
***************
*** 590,598 ****
  {
    set_cursor(HOURGLASS) ;
    move = TRUE ;            /* Make sure the computer clock is decremented. */
    play_reve(board.square, player, level, &move, &note) ;
    set_cursor(CANVASCUR) ;
!   animate_move(move) ;
    do_move(player) ;
    last_move = move ;
    cmode = (enum cantype) (OPPONENT(player) + 1) ;
--- 636,648 ----
  {
    set_cursor(HOURGLASS) ;
    move = TRUE ;            /* Make sure the computer clock is decremented. */
+   best_cmove = -1 ;
+   message(EVAL_MES, "") ;
    play_reve(board.square, player, level, &move, &note) ;
    set_cursor(CANVASCUR) ;
!   if (animation == TRUE) animate_move(move) ;
!   if (best_cmove != -1 && do_bestmove == TRUE)
!     draw_square(best_cmove, IS_OFF, 2) ;
    do_move(player) ;
    last_move = move ;
    cmode = (enum cantype) (OPPONENT(player) + 1) ;
***************
*** 603,612 ****
  usage()
  {
    FPRINTF(stderr, "%s version 1.1.%1d\n\n", progname, PATCHLEVEL) ;
!   FPRINTF(stderr, "Usage: %s: [-b [display] ] [-c]\n", progname) ;
!   FPRINTF(stderr, "\t[-d difficulty] [-e edgefile] [-g geometry]\n") ;
!   FPRINTF(stderr, "\t[-l gamefile] [-v] [-w [display] ] [-?] [-Wi]\n") ;
!   FPRINTF(stderr, "\t[-Wp x y] [-WP x y]\n") ;
  }
  
  
--- 653,663 ----
  usage()
  {
    FPRINTF(stderr, "%s version 1.1.%1d\n\n", progname, PATCHLEVEL) ;
!   FPRINTF(stderr, "Usage: %s: [-animate] [-bestmove]\n", progname) ;
!   FPRINTF(stderr, "\t[-black [display] ] [-c] [-d difficulty]\n") ;
!   FPRINTF(stderr, "\t[-e edgefile] [-g geometry] [-last]\n") ;
!   FPRINTF(stderr, "\t[-load gamefile] [-number] [-notes] [-v]\n") ;
!   FPRINTF(stderr, "\t[-w [display] ] [-?] [-Wi] [-Wp x y] [-WP x y]\n") ;
  }
  
  
***************
*** 614,624 ****
--- 665,682 ----
  usleep(x)        /* Suspend execution for interval in microseconds. */
  unsigned x ;
  {
+ #ifdef NOSELECT
+   unsigned seconds = x / 1000 ;
+ 
+   if (x > 0) sleep(x) ;
+ #else
+ 
    struct timeval st_delay ;
  
    st_delay.tv_usec = x ;
    st_delay.tv_sec = 0 ;
    (void) select(32, NULL, NULL, NULL, &st_delay) ;
+ #endif /*NOSELECT*/
  }	
  #endif /*NO_USLEEP*/
  

------- procs.c -------
*** /tmp/da02133	Wed Nov 28 11:00:29 1990
--- procs.c	Fri Nov 23 07:12:47 1990
***************
*** 41,57 ****
  {
    int cx, cy ;
  
    set_cursor(CANVASCUR) ;
    if (state == LEFT_DOWN)
      {
!       draw_piece(next_player, piece_x, piece_y, RINV) ;
        cmode = (enum cantype) ((int) cmode - 1) ;
      }
    else
      {
!       draw_piece(next_player, piece_x, piece_y, RINV) ;
!       cx = (piece_x + PIECE_RAD - BBORDER) / CELL_SIZE ;
!       cy = (piece_y + PIECE_RAD - CY - BBORDER) / CELL_SIZE ;
        move = cy * BOARD_SIZE + cx ;
        make_move() ;
      }
--- 41,62 ----
  {
    int cx, cy ;
  
+   cx = (piece_x + PIECE_RAD - BBORDER) / CELL_SIZE ;
+   cy = (piece_y + PIECE_RAD - CY - BBORDER) / CELL_SIZE ;
+ 
    set_cursor(CANVASCUR) ;
    if (state == LEFT_DOWN)
      {
!       draw_outline(cy * BOARD_SIZE + cx, IS_ON) ;
!       if (animation == TRUE)
!         draw_piece(next_player, piece_x, piece_y, RINV) ;
        cmode = (enum cantype) ((int) cmode - 1) ;
      }
    else
      {
!       if (animation == TRUE)
!         draw_piece(next_player, piece_x, piece_y, RINV) ;
!       draw_outline(last_outline, IS_OFF) ;
        move = cy * BOARD_SIZE + cx ;
        make_move() ;
      }
***************
*** 171,177 ****
                         break ;
        case DECREMENT : if (--item_value == -1)
                           {
!                            while (choices[++item_value] != NULL) ;
                             item_value-- ;
                             items[(int) item].value = item_value ;
                           }
--- 176,182 ----
                         break ;
        case DECREMENT : if (--item_value == -1)
                           {
!                            while (choices[++item_value] != NULL) continue ;
                             item_value-- ;
                             items[(int) item].value = item_value ;
                           }
***************
*** 218,223 ****
--- 223,229 ----
              suggest_x+5, CY+suggest_y+5, RSRC, C_BLACK) ;
    draw_line(suggest_x-5, CY+suggest_y+5,
              suggest_x+5, CY+suggest_y-5, RSRC, C_BLACK) ;
+   if (show_notes) set_eval(player, suggestion, note) ;
  }
  
  
***************
*** 254,260 ****
    if (n >= 3)
      {
        show_last(last_move, IS_OFF) ;
!       FOR_BOARD(i) board.square[i] = moves[n].square[i] ;
        board.moves_left = moves[n].moves_left ;
        board.player     = moves[n].player ;
        board.move       = moves[n].move ;
--- 260,278 ----
    if (n >= 3)
      {
        show_last(last_move, IS_OFF) ;
!       show_number(last_move, IS_OFF) ;
!       FOR_BOARD(i)
!         {
!           if (moves[n].square[i] != board.square[i])
!             {
!               get_xy(i, &x, &y) ;
!               if (moves[n].square[i] == FREE)
!                 color_area(x, CY+y, PSIZE, PSIZE,
!                            (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
!               else draw_piece(moves[n].square[i], x, CY+y, RSRC) ;
!             }
!           board.square[i] = moves[n].square[i] ;
!         }
        board.moves_left = moves[n].moves_left ;
        board.player     = moves[n].player ;
        board.move       = moves[n].move ;
***************
*** 276,290 ****
        else                           cmode = WHITE_START ;
        message(PANEL_MES, "") ;
  
!       FOR_BOARD(i)
          {
!           get_xy(i, &x, &y) ;
!           if (board.square[i] == FREE)
!             color_area(x, CY+y, PSIZE, PSIZE,
!                        (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
!           else draw_piece(board.square[i], x, CY+y, RSRC) ;
          }
!       if (n > 3) show_last(last_move, IS_ON) ;
        next_player = OPPONENT(board.player) ;
      }
    else message(PANEL_MES, "No moves to undo.") ;
--- 294,306 ----
        else                           cmode = WHITE_START ;
        message(PANEL_MES, "") ;
  
!       if (n > 3)
          {
!           show_last(last_move, IS_ON) ;
!           show_number(last_move, IS_ON) ;
!           if (show_notes) set_eval(board.player, board.move, board.note) ;
          }
!       else message(EVAL_MES, "") ;
        next_player = OPPONENT(board.player) ;
      }
    else message(PANEL_MES, "No moves to undo.") ;

------- rev_eval.c -------
*** /tmp/da02136	Wed Nov 28 11:00:29 1990
--- rev_eval.c	Tue Nov 20 10:31:35 1990
***************
*** 36,42 ****
   *     - Potential Mobility, looking at squares contacts
   *  And then Eval = c1 * ES + c2 * ( CM + cx * XV ) + c3 * PM
   *  Eval is replaced by - Eval if Black is replaced by White. Eval is positive
!  *  if macouleur ( my color ) has a good position and negatif if tacouleur
   *  position is good.
   *  If we are "near" the end of the game, then Eval is equal to final disc
   *  differential.
--- 36,42 ----
   *     - Potential Mobility, looking at squares contacts
   *  And then Eval = c1 * ES + c2 * ( CM + cx * XV ) + c3 * PM
   *  Eval is replaced by - Eval if Black is replaced by White. Eval is positive
!  *  if macouleur ( my color ) has a good position and negative if tacouleur
   *  position is good.
   *  If we are "near" the end of the game, then Eval is equal to final disc
   *  differential.
***************
*** 83,88 ****
--- 83,94 ----
          }
        note = edges[i] ;
  
+       if (((i == 2191) && (d[13] == macouleur)) ||
+           ((i == 2917) && (d[10] == macouleur)) ||
+           ((i == 3643) && (d[10] == tacouleur)) ||
+           ((i == 4369) && (d[13] == tacouleur)))
+         note -= edges[i] ;
+ 
        i = 0 ;
        for (p = &d[56]; p < &d[64]; p++)
          {
***************
*** 92,97 ****
--- 98,109 ----
          }
        note += edges[i] ;
  
+       if (((i == 2191) && (d[53] == macouleur)) ||
+           ((i == 2917) && (d[50] == macouleur)) ||
+           ((i == 3643) && (d[50] == tacouleur)) ||
+           ((i == 4369) && (d[53] == tacouleur)))
+         note -= edges[i] ;
+ 
        i = 0 ;
        for (p = &d[0]; p < &d[64]; p += 8)
          {
***************
*** 101,106 ****
--- 113,124 ----
          }
        note += edges[i] ;
  
+       if (((i == 2191) && (d[41] == macouleur)) ||
+           ((i == 2917) && (d[17] == macouleur)) ||
+           ((i == 3643) && (d[17] == tacouleur)) ||
+           ((i == 4369) && (d[41] == tacouleur)))
+         note -= edges[i] ;
+ 
        i = 0 ;
        for (p = &d[7]; p < &d[64]; p += 8)
          {
***************
*** 109,114 ****
--- 127,138 ----
            else if (*p == macouleur) i += 2 ;
          }
        note += edges[i] ;
+ 
+       if (((i == 2191) && (d[46] == macouleur)) ||
+           ((i == 2917) && (d[22] == macouleur)) ||
+           ((i == 3643) && (d[22] == tacouleur)) ||
+           ((i == 4369) && (d[46] == tacouleur)))
+         note -= edges[i] ;
  
        cx = 8 * (50 - mnb - profmax) ;
  

------- rev_ip.c -------
*** /tmp/da02139	Wed Nov 28 11:00:30 1990
--- rev_ip.c	Fri Nov 23 23:17:29 1990
***************
*** 23,29 ****
--- 23,34 ----
  #include <signal.h>
  #include <setjmp.h>
  #include <sys/types.h>
+ #ifdef SYSV
+ #include <sys/times.h>
+ #else
  #include <sys/time.h>
+ #endif /*SYSV*/
+ 
  #include "reve.h"
  
  extern int saveres ;
***************
*** 166,172 ****
  
    if (((k == 1) && (mnb < 52)) || (mnb == 1))
      {
!       for (cp = 0; d0[cpk[cp]] != JPJ; cp++) ;
        cpi[0] = cpi[cp] ;
        cpj[0] = cpj[cp] ;
        cpk[0] = cpk[cp] ;
--- 171,177 ----
  
    if (((k == 1) && (mnb < 52)) || (mnb == 1))
      {
!       for (cp = 0; d0[cpk[cp]] != JPJ; cp++) continue ;
        cpi[0] = cpi[cp] ;
        cpj[0] = cpj[cp] ;
        cpk[0] = cpk[cp] ;
***************
*** 219,229 ****
        allotime = timeleft * 3 / (61 - mnb) ;
        firsttime = time((time_t *) NULL) ;
  
!       signal(SIGALRM, catcher) ;
  
        if (setjmp(jumper) != 0)
          {
!           if (cpmax == 0) note = oldnote ;
            profmax = -profmax ;
            goto trap ;
          }
--- 224,236 ----
        allotime = timeleft * 3 / (61 - mnb) ;
        firsttime = time((time_t *) NULL) ;
  
!       cpmaxi[0] = cpmaxi[1] = cpmaxi[2] = cpmaxi[3] = 0 ;
  
+       SIGNAL(SIGALRM, catcher) ;
+ 
        if (setjmp(jumper) != 0)
          {
!           if (note == -1000000000) note = oldnote ;
            profmax = -profmax ;
            goto trap ;
          }
***************
*** 233,239 ****
            oldnote = note ;
            note = -1000000000 ;
  
!           if ((int) (allotime - timeused) > 2) alarm(allotime - timeused) ;
  
            c1 = 312 + 6 * (mnb + profmax) ;
            if (mnb + profmax < 25)
--- 240,247 ----
            oldnote = note ;
            note = -1000000000 ;
  
!           if ((int) (allotime - timeused) > 2)
!             ALARM((unsigned) (allotime - timeused)) ;
  
            c1 = 312 + 6 * (mnb + profmax) ;
            if (mnb + profmax < 25)
***************
*** 247,254 ****
            if (profmax > 53 - mnb)
              {
                profmax = 61 - mnb ;
!               allotime = timeleft * 3 / 5 ;
!               if ((int) (allotime - timeused) > 2) alarm(allotime - timeused) ;
              }
  
            for (cp = 0; cp <= 60 - mnb; cp++)
--- 255,263 ----
            if (profmax > 53 - mnb)
              {
                profmax = 61 - mnb ;
!               allotime = timeleft * 2 / 3 ;
!               if ((int) (allotime - timeused) > 2)
!                 ALARM((unsigned) (allotime - timeused)) ;
              }
  
            for (cp = 0; cp <= 60 - mnb; cp++)
***************
*** 267,283 ****
                      {
                        note = lnote ;
                        cpmax = cp ;
                      }
                  }
              }
  
!           alarm(0) ;
            cpmaxi[0] = cpmax ;
  
            if ((mnb < 57) && (cpmaxi[0] != cpmaxi[1])
                && (cpmaxi[1] != cpmaxi[2]) && (cpmaxi[0] != cpmaxi[2]))
              {
-               if (cpmax == 0) count++ ; else count = 1 ;
                for (cp = 0; cp <= 60 - mnb; cp++) cpf[cp] = TRUE ;
                for (k = 0; k < 3; k++)
                  {
--- 276,294 ----
                      {
                        note = lnote ;
                        cpmax = cp ;
+                       show_best(cpk[cpmax], lnote) ;
                      }
                  }
              }
  
!           ALARM(0) ;
            cpmaxi[0] = cpmax ;
+           if (cpmax == 0) count += 2 ;
+           else            count = 1 ;
  
            if ((mnb < 57) && (cpmaxi[0] != cpmaxi[1])
                && (cpmaxi[1] != cpmaxi[2]) && (cpmaxi[0] != cpmaxi[2]))
              {
                for (cp = 0; cp <= 60 - mnb; cp++) cpf[cp] = TRUE ;
                for (k = 0; k < 3; k++)
                  {
***************
*** 318,324 ****
            timeused = time((time_t *) NULL) - firsttime ;
            if ((mnb == 4) && (profmax == 3)) break ;
          }
!       while ((timeused * count < allotime * 5 / 4) && (profmax != 61 - mnb)) ;
  trap:
        timeused = time((time_t *) NULL) - firsttime ;
        if (timeused == 0) timeused = 1 ;
--- 329,335 ----
            timeused = time((time_t *) NULL) - firsttime ;
            if ((mnb == 4) && (profmax == 3)) break ;
          }
!       while ((timeused * count < allotime * 4 / 5) && (profmax != 61 - mnb)) ;
  trap:
        timeused = time((time_t *) NULL) - firsttime ;
        if (timeused == 0) timeused = 1 ;
***************
*** 354,361 ****
  long alpha, beta ;
  {
    register int *d0, *d1 ;
!   register int k, cp, cpmax ;
    register long lnote, note ;
  
    d0 = damier[niv] ;
    d1 = damier[niv + 1] ;
--- 365,373 ----
  long alpha, beta ;
  {
    register int *d0, *d1 ;
!   register int k, cp ;
    register long lnote, note ;
+   register int cpmax = 0 ;
  
    d0 = damier[niv] ;
    d1 = damier[niv + 1] ;
***************
*** 402,409 ****
  long alpha, beta ;
  {
    register int *d0, *d1 ;
!   register int k, cp, cpmax ;
    register long lnote, note ;
  
    d0 = damier[niv] ;
    d1 = damier[niv + 1] ;
--- 414,422 ----
  long alpha, beta ;
  {
    register int *d0, *d1 ;
!   register int k, cp ;
    register long lnote, note ;
+   register int cpmax = 0 ;
  
    d0 = damier[niv] ;
    d1 = damier[niv + 1] ;

------- rev_iycp.c -------
*** /tmp/da02142	Wed Nov 28 11:00:31 1990
--- rev_iycp.c	Tue Nov 20 10:53:09 1990
***************
*** 60,66 ****
  
                for (x = posx + 1;
                     (x < 7) && (d[(x << 3) + posy] == tacouleur);
!                    x++) ;
                if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
                  {
                    flag = TRUE ;
--- 60,66 ----
  
                for (x = posx + 1;
                     (x < 7) && (d[(x << 3) + posy] == tacouleur);
!                    x++) continue ;
                if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 71,77 ****
  
                for (x = posx - 1;
                     (x > 0) && (d[(x << 3) + posy] == tacouleur);
!                    x--) ;
                if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
                  {
                    flag = TRUE ;
--- 71,77 ----
  
                for (x = posx - 1;
                     (x > 0) && (d[(x << 3) + posy] == tacouleur);
!                    x--) continue ;
                if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 82,88 ****
  
                for (y = posy + 1;
                     (y < 7) && (d[pos8x + y] == tacouleur);
!                    y++) ;
                if ((y != posy + 1) && (d[pos8x + y] == macouleur))
                  {
                    flag = TRUE ;
--- 82,88 ----
  
                for (y = posy + 1;
                     (y < 7) && (d[pos8x + y] == tacouleur);
!                    y++) continue ;
                if ((y != posy + 1) && (d[pos8x + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 93,99 ****
  
                for (y = posy - 1;
                     (y > 0) && (d[pos8x + y] == tacouleur);
!                    y--) ;
                if ((y != posy - 1) && (d[pos8x + y] == macouleur))
                  {
                    flag = TRUE ;
--- 93,99 ----
  
                for (y = posy - 1;
                     (y > 0) && (d[pos8x + y] == tacouleur);
!                    y--) continue ;
                if ((y != posy - 1) && (d[pos8x + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 104,110 ****
  
                for (x = posx + 1,  y = posy + 1; 
                     (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!                    x++, y++) ;
                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
--- 104,110 ----
  
                for (x = posx + 1,  y = posy + 1; 
                     (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!                    x++, y++) continue ;
                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 115,121 ****
  
                for (x = posx - 1,  y = posy + 1; 
                     (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!                    x--, y++) ;
                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
--- 115,121 ----
  
                for (x = posx - 1,  y = posy + 1; 
                     (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!                    x--, y++) continue ;
                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 126,132 ****
  
                for (x = posx + 1,  y = posy - 1; 
                     (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!                    x++, y--) ;
                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
--- 126,132 ----
  
                for (x = posx + 1,  y = posy - 1; 
                     (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!                    x++, y--) continue ;
                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 137,143 ****
  
                for (x = posx - 1,  y = posy - 1; 
                     (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!                    x--, y--) ;
                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
--- 137,143 ----
  
                for (x = posx - 1,  y = posy - 1; 
                     (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!                    x--, y--) continue ;
                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
                  {
                    flag = TRUE ;
***************
*** 152,165 ****
  }
  
  
! jejoueen(px, py, niv)
! int px, py, niv ;
  {
    register int *d ;
!   register int x, y, posx, posy, pos8x ;
  
-   posx = px ;
-   posy = py ;
    pos8x = posx << 3 ;
  
    d = damier[niv] ;
--- 152,163 ----
  }
  
  
! jejoueen(posx, posy, niv)
! int posx, posy, niv ;
  {
    register int *d ;
!   register int x, y, pos8x ;
  
    pos8x = posx << 3 ;
  
    d = damier[niv] ;
***************
*** 166,172 ****
  
    d[pos8x + posy] = macouleur ;
  
!   for (x = posx + 1; (x < 7) && (d[(x << 3) + posy] == tacouleur); x++) ;
    if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
      {
        for (x = posx + 1; d[(x << 3) + posy] == tacouleur; x++)
--- 164,171 ----
  
    d[pos8x + posy] = macouleur ;
  
!   for (x = posx + 1;
!        (x < 7) && (d[(x << 3) + posy] == tacouleur); x++) continue ;
    if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
      {
        for (x = posx + 1; d[(x << 3) + posy] == tacouleur; x++)
***************
*** 173,179 ****
          d[(x << 3) + posy] = macouleur ;
      }
  
!   for (x = posx - 1; (x > 0) && (d[(x << 3) + posy] == tacouleur); x--) ;
    if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
      {
        for (x = posx - 1; d[(x << 3) + posy] == tacouleur; x--)
--- 172,179 ----
          d[(x << 3) + posy] = macouleur ;
      }
  
!   for (x = posx - 1;
!        (x > 0) && (d[(x << 3) + posy] == tacouleur); x--) continue ;
    if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
      {
        for (x = posx - 1; d[(x << 3) + posy] == tacouleur; x--)
***************
*** 180,186 ****
          d[(x << 3) + posy] = macouleur ;
      }
  
!   for (y = posy + 1; (y < 7) && (d[pos8x + y] == tacouleur); y++) ;
    if ((y != posy + 1) && (d[pos8x + y] == macouleur))
      {
        for (y = posy + 1; d[pos8x + y] == tacouleur; y++)
--- 180,187 ----
          d[(x << 3) + posy] = macouleur ;
      }
  
!   for (y = posy + 1;
!        (y < 7) && (d[pos8x + y] == tacouleur); y++) continue ;
    if ((y != posy + 1) && (d[pos8x + y] == macouleur))
      {
        for (y = posy + 1; d[pos8x + y] == tacouleur; y++)
***************
*** 187,193 ****
          d[pos8x + y] = macouleur ;
      }
  
!   for (y = posy - 1; (y > 0) && (d[pos8x + y] == tacouleur); y--) ;
    if ((y != posy - 1) && (d[pos8x + y] == macouleur))
      {
        for (y = posy - 1; d[pos8x + y] == tacouleur; y--)
--- 188,195 ----
          d[pos8x + y] = macouleur ;
      }
  
!   for (y = posy - 1;
!        (y > 0) && (d[pos8x + y] == tacouleur); y--) continue ;
    if ((y != posy - 1) && (d[pos8x + y] == macouleur))
      {
        for (y = posy - 1; d[pos8x + y] == tacouleur; y--)
***************
*** 195,201 ****
      }
  
    for (x = posx + 1, y = posy + 1;
!        (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur); x++, y++) ;
    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x++, y++)
--- 197,204 ----
      }
  
    for (x = posx + 1, y = posy + 1;
!        (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!        x++, y++) continue ;
    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x++, y++)
***************
*** 203,209 ****
      }
  
    for (x = posx - 1, y = posy + 1;
!        (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur); x--, y++) ;
    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x--, y++)
--- 206,213 ----
      }
  
    for (x = posx - 1, y = posy + 1;
!        (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
!        x--, y++) continue ;
    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x--, y++)
***************
*** 211,217 ****
      }
  
    for (x = posx + 1, y = posy - 1;
!        (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur); x++, y--) ;
    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x++, y--)
--- 215,222 ----
      }
  
    for (x = posx + 1, y = posy - 1;
!        (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!        x++, y--) continue ;
    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x++, y--)
***************
*** 219,225 ****
      }
  
    for (x = posx - 1, y = posy - 1;
!        (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur); x--, y--) ;
    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x--, y--)
--- 224,231 ----
      }
  
    for (x = posx - 1, y = posy - 1;
!        (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
!        x--, y--) continue ;
    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
      {
        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x--, y--)
***************
*** 249,255 ****
              {
                for (x = posx + 1;
                     (x < 7) && (d[(x << 3) + posy] == macouleur);
!                    x++) ;
                if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
                  {
                    flag = TRUE ;
--- 255,261 ----
              {
                for (x = posx + 1;
                     (x < 7) && (d[(x << 3) + posy] == macouleur);
!                    x++) continue ;
                if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 260,266 ****
  
                for (x = posx - 1;
                     (x > 0) && (d[(x << 3) + posy] == macouleur) ;
!                    x--) ;
                if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
                  {
                    flag = TRUE ;
--- 266,272 ----
  
                for (x = posx - 1;
                     (x > 0) && (d[(x << 3) + posy] == macouleur) ;
!                    x--) continue ;
                if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 271,277 ****
  
                for (y = posy + 1;
                     (y < 7) && (d[pos8x + y] == macouleur);
!                    y++) ;
                if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 277,283 ----
  
                for (y = posy + 1;
                     (y < 7) && (d[pos8x + y] == macouleur);
!                    y++) continue ;
                if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 282,288 ****
  
                for (y = posy - 1;
                     (y > 0) && (d[pos8x + y] == macouleur);
!                    y--) ;
                if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 288,294 ----
  
                for (y = posy - 1;
                     (y > 0) && (d[pos8x + y] == macouleur);
!                    y--) continue ;
                if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 293,299 ****
  
                for (x = posx + 1,  y = posy + 1; 
                     (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
!                    x++, y++);
                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 299,305 ----
  
                for (x = posx + 1,  y = posy + 1; 
                     (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
!                    x++, y++) continue ;
                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 304,310 ****
  
                for (x = posx - 1,  y = posy + 1; 
                     (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
!                    x--, y++) ;
                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 310,316 ----
  
                for (x = posx - 1,  y = posy + 1; 
                     (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
!                    x--, y++) continue ;
                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 315,321 ****
  
                for (x = posx + 1,  y = posy - 1; 
                     (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
!                    x++, y--) ;
                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 321,327 ----
  
                for (x = posx + 1,  y = posy - 1; 
                     (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
!                    x++, y--) continue ;
                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 326,332 ****
  
                for (x = posx - 1,  y = posy - 1; 
                     (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur) ;
!                    x--, y-- ) ;
                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
--- 332,338 ----
  
                for (x = posx - 1,  y = posy - 1; 
                     (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur) ;
!                    x--, y-- ) continue ;
                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
                  {
                    flag = TRUE ;
***************
*** 341,360 ****
  }
  
  
! tujouesen(px, py, niv)
! int px, py, niv ;
  {
    register int *d ;
!   register int x, y, posx, posy, pos8x ;
  
-   posx = px ;
-   posy = py ;
- 
    pos8x = posx << 3 ;
    d = damier[niv] ;
    d[pos8x + posy] = tacouleur ;
  
!   for (x = posx + 1; (x < 7) && (d[(x << 3) + posy] == macouleur); x++) ;
    if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
      {
        for (x = posx + 1; d[(x << 3) + posy] == macouleur; x++)
--- 347,364 ----
  }
  
  
! tujouesen(posx, posy, niv)
! int posx, posy, niv ;
  {
    register int *d ;
!   register int x, y, pos8x ;
  
    pos8x = posx << 3 ;
    d = damier[niv] ;
    d[pos8x + posy] = tacouleur ;
  
!   for (x = posx + 1;
!        (x < 7) && (d[(x << 3) + posy] == macouleur); x++) continue ;
    if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
      {
        for (x = posx + 1; d[(x << 3) + posy] == macouleur; x++)
***************
*** 361,367 ****
          d[(x << 3) + posy] = tacouleur ;
      }
  
!   for (x = posx - 1; (x > 0) && (d[(x << 3) + posy] == macouleur); x--) ;
    if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
      {
        for (x = posx - 1; d[(x << 3) + posy] == macouleur; x--)
--- 365,372 ----
          d[(x << 3) + posy] = tacouleur ;
      }
  
!   for (x = posx - 1;
!        (x > 0) && (d[(x << 3) + posy] == macouleur); x--) continue ;
    if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
      {
        for (x = posx - 1; d[(x << 3) + posy] == macouleur; x--)
***************
*** 368,374 ****
          d[(x << 3) + posy] = tacouleur ;
      }
  
!   for (y = posy + 1; (y < 7) && (d[pos8x + y] == macouleur); y++) ;
    if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
      {
        for (y = posy + 1; d[pos8x + y] == macouleur; y++)
--- 373,380 ----
          d[(x << 3) + posy] = tacouleur ;
      }
  
!   for (y = posy + 1;
!        (y < 7) && (d[pos8x + y] == macouleur); y++) continue ;
    if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
      {
        for (y = posy + 1; d[pos8x + y] == macouleur; y++)
***************
*** 375,381 ****
          d[pos8x + y] = tacouleur ;
      }
  
!   for (y = posy - 1; (y > 0) && (d[pos8x + y] == macouleur); y--) ;
    if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
      {
        for (y = posy - 1; d[pos8x + y] == macouleur; y--)
--- 381,388 ----
          d[pos8x + y] = tacouleur ;
      }
  
!   for (y = posy - 1;
!        (y > 0) && (d[pos8x + y] == macouleur); y--) continue ;
    if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
      {
        for (y = posy - 1; d[pos8x + y] == macouleur; y--)
***************
*** 384,390 ****
  
    for (x = posx + 1, y = posy + 1;
         (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
!        x++, y++) ;
    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == macouleur; x++, y++)
--- 391,397 ----
  
    for (x = posx + 1, y = posy + 1;
         (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
!        x++, y++) continue ;
    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == macouleur; x++, y++)
***************
*** 393,399 ****
  
    for (x = posx - 1, y = posy + 1;
         (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
!        x--, y++) ;
    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == macouleur; x--, y++)
--- 400,406 ----
  
    for (x = posx - 1, y = posy + 1;
         (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
!        x--, y++) continue ;
    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == macouleur; x--, y++)
***************
*** 402,408 ****
  
    for (x = posx + 1, y = posy - 1;
         (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
!        x++, y--) ;
    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == macouleur; x++, y--)
--- 409,415 ----
  
    for (x = posx + 1, y = posy - 1;
         (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
!        x++, y--) continue ;
    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == macouleur; x++, y--)
***************
*** 411,417 ****
  
    for (x = posx - 1, y = posy - 1;
         (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur);
!        x--, y--) ;
    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == macouleur; x--, y--)
--- 418,424 ----
  
    for (x = posx - 1, y = posy - 1;
         (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur);
!        x--, y--) continue ;
    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
      {
        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == macouleur; x--, y--)

richb@sunaus.oz (Rich Burridge) (11/28/90)

------CUT HERE------patch 2 - part 3------CUT HERE------

------- reve.h -------
*** /tmp/da02145	Wed Nov 28 11:00:32 1990
--- reve.h	Fri Nov 23 23:16:36 1990
***************
*** 25,31 ****
  #include <stdio.h>
  #include <sys/types.h>
  
! #define  FCLOSE        (void) fclose      /* To make lint happy. */
  #define  FFLUSH        (void) fflush
  #define  FGETS         (void) fgets
  #define  FSEEK         (void) fseek
--- 25,32 ----
  #include <stdio.h>
  #include <sys/types.h>
  
! #define  ALARM         (void) alarm       /* To make lint happy. */
! #define  FCLOSE        (void) fclose
  #define  FFLUSH        (void) fflush
  #define  FGETS         (void) fgets
  #define  FSEEK         (void) fseek
***************
*** 64,70 ****
  #else
  #define  CELL_SIZE     (int) ((TOTAL_WIDTH-(2*BBORDER)) / BOARD_SIZE)
  #define  CY            ((NOROWS*BHEIGHT) + ((NOROWS-1)*BGAP) + (2*BBORDER))
! #define  NOROWS        6        /* Number of rows of reve items. */
  #define  TOTAL_HEIGHT  CY + (8 * CELL_SIZE) + (2 * BBORDER)
  #define  TOTAL_WIDTH   ((NOBUTS*BWIDTH) + ((NOBUTS-1)*BGAP) + (2*BBORDER))
  #endif /*XVIEW*/
--- 65,71 ----
  #else
  #define  CELL_SIZE     (int) ((TOTAL_WIDTH-(2*BBORDER)) / BOARD_SIZE)
  #define  CY            ((NOROWS*BHEIGHT) + ((NOROWS-1)*BGAP) + (2*BBORDER))
! #define  NOROWS        7        /* Number of rows of reve items. */
  #define  TOTAL_HEIGHT  CY + (8 * CELL_SIZE) + (2 * BBORDER)
  #define  TOTAL_WIDTH   ((NOBUTS*BWIDTH) + ((NOBUTS-1)*BGAP) + (2*BBORDER))
  #endif /*XVIEW*/
***************
*** 231,239 ****
  void do_move(),            do_selection(),       domove() ;
  void done(),               draw_button(),        draw_cycle() ;
  void draw_cycle_item(),    draw_image(),         draw_line() ;
! void draw_piece(),         draw_rect(),          draw_stencil() ;
! void draw_text(),          draw_textfield() ;
! void generate_graphics(),  get_filename() ;
  void get_options(),        get_xy(),             getparam() ;
  void handle_board_event(), handle_event(),       handle_item() ;
  void handle_key(),         init_canvas(),        init_edge_table() ;
--- 232,240 ----
  void do_move(),            do_selection(),       domove() ;
  void done(),               draw_button(),        draw_cycle() ;
  void draw_cycle_item(),    draw_image(),         draw_line() ;
! void draw_outline(),       draw_piece(),         draw_rect() ;
! void draw_square(),        draw_stencil(),       draw_text() ;
! void draw_textfield(),     generate_graphics(),  get_filename() ;
  void get_options(),        get_xy(),             getparam() ;
  void handle_board_event(), handle_event(),       handle_item() ;
  void handle_key(),         init_canvas(),        init_edge_table() ;
***************
*** 245,253 ****
  void message(),            nap_upto(),           new_game() ;
  void position_popup(),     process_event(),      quit() ;
  void remove_textfield(),   save_game(),          set_cursor() ;
! void set_cycle(),          set_display_types() ;
! void set_timer(),          set_score(),          set_turn() ;
! void show_all(),           show_all_moves(),     show_last() ;
  void show_suggestion(),    start_tool() ;
  void suggest(),            think(),              undo() ;
  void update_board_image(), usage(),              who_wins() ;
--- 246,255 ----
  void message(),            nap_upto(),           new_game() ;
  void position_popup(),     process_event(),      quit() ;
  void remove_textfield(),   save_game(),          set_cursor() ;
! void set_cycle(),          set_display_types(),  set_eval() ;
! void set_score(),          set_timer(),          set_turn() ;
! void show_all(),           show_all_moves(),     show_best() ;
! void show_last(),          show_number() ;
  void show_suggestion(),    start_tool() ;
  void suggest(),            think(),              undo() ;
  void update_board_image(), usage(),              who_wins() ;

------- reve.man.text -------
*** /tmp/da02148	Wed Nov 28 11:00:33 1990
--- reve.man.text	Fri Nov 23 07:05:48 1990
***************
*** 9,18 ****
       reve - an othello game.
  
  SYNOPSIS
!      reve [ -b [ display ] ] [ -c ] [ -d difficulty ] [ -e  edge-
!      file  ] [ -g geometry ] [ -i ] [ -l gamefile ] [ -m ] [ -n ]
!      [ -r ] [ -v ] [ -w [ display ] ] [ -? ] [ -Wi ] [ -Wp x y  ]
!      [ -WP x y ]
  
  DESCRIPTION
       Reve is a version of the popular Othello game.  It  contains
--- 9,19 ----
       reve - an othello game.
  
  SYNOPSIS
!      reve [ -animate ] [ -b [ display ] ] [ -c ] [ -d  difficulty
!      ]  [  -e edgefile ] [ -g geometry ] [ -i ] [ -last ] [ -load
!      gamefile ] [ -m ] [ -notes ] [ -number ] [ -quick ] [ -r ] [
!      -v ] [ -w [ display ] ] [ -? ] [ -Wi ] [ -Wp x y ] [ -WP x y
!      ]
  
  DESCRIPTION
       Reve is a version of the popular Othello game.  It  contains
***************
*** 20,47 ****
       being able to function on normal display terminals  using  a
       termcap interface.
  
!      Reve is played on an 8 x 8 board, with pieces  which  should
       be  considered  to  be  black  on  one side and white on the
!      other. A legal move consists of placing a piece of one's own
       color  on  the  board  so  as to "sandwich" one or more rows
!      (orthogonal or diagonal) of pieces  of  the  opposite  color
!      between  the piece just placed and another piece of the same
!      color. All pieces so sandwiched are flipped over  to  reveal
       the color of the other side (your own color).
  
!      The object of the game, is to  have  more  pieces  than  the
       opponent  at the end of the game (ie. when the board is full
       or neither side has a legal move).  If  you  have  no  legal
       move, you simply miss a turn.  Black goes first.
  
!      With reve, to place one of your own pieces simply click with
!      the  mouse  over  the square in which you want your piece to
       go. Note that it is also possible to supply a number  and  a
!      letter pair, to indicate where you would like your new piece
!      to go. This is the only method to place pieces with the dumb
       tty  interface.  The square containing the last move will be
       shown with a black outline. This is updated  with  each  new
!      move.
  
       There are various buttons and cyclic  selections  available.
       Their  meanings are given below, plus an indication of their
--- 21,50 ----
       being able to function on normal display terminals  using  a
       termcap interface.
  
!      Reve is played on an 8 x 8 board, with stones  which  should
       be  considered  to  be  black  on  one side and white on the
!      other. A legal move consists of placing a stone of one's own
       color  on  the  board  so  as to "sandwich" one or more rows
!      (orthogonal or diagonal) of stones  of  the  opposite  color
!      between  the stone just placed and another stone of the same
!      color. All stones so sandwiched are flipped over  to  reveal
       the color of the other side (your own color).
  
!      The object of the game, is to  have  more  stones  than  the
       opponent  at the end of the game (ie. when the board is full
       or neither side has a legal move).  If  you  have  no  legal
       move, you simply miss a turn.  Black goes first.
  
!      With reve, to place one of your own stones simply click with
!      the  mouse  over  the square in which you want your stone to
       go. Note that it is also possible to supply a number  and  a
!      letter pair, to indicate where you would like your new stone
!      to go. This is the only method to place stones with the dumb
       tty  interface.  The square containing the last move will be
       shown with a black outline. This is updated  with  each  new
!      move.  If  you hold the mouse button down as you move around
!      the board,  the  square  you  are  currently  over  will  be
!      highlighted.
  
       There are various buttons and cyclic  selections  available.
       Their  meanings are given below, plus an indication of their
***************
*** 54,65 ****
  
       By default, a human will play black, and the  computer  will
       play  white.  If  you  want a human vs human startup or some
-      other combination, then you should use the appropriate  com-
-      mand line options (see below).
  
  
  
- 
  Sun Release 4.1   Last change: 18 October 1990                  1
  
  
--- 57,65 ----
***************
*** 71,76 ****
--- 71,79 ----
  
  
  
+      other combination, then you should use the appropriate  com-
+      mand line options (see below).
+ 
  REVE BUTTONS
       With the graphics versions, there are eight buttons that are
       normally  displayed  at  the top of the Reve window. Each of
***************
*** 90,97 ****
                         unsuccessful, it will stop on the  invalid
                         line,  and  display  an  error message. As
                         each line is successfully  read  from  the
!                        game  file,  the piece is displayed on the
!                        board, and the appropriate pieces flipped.
  
       moves? [ A ]      Show all the valid moves for  the  current
                         board.  This  is useful for beginners, and
--- 93,100 ----
                         unsuccessful, it will stop on the  invalid
                         line,  and  display  an  error message. As
                         each line is successfully  read  from  the
!                        game  file,  the stone is displayed on the
!                        board, and the appropriate stones flipped.
  
       moves? [ A ]      Show all the valid moves for  the  current
                         board.  This  is useful for beginners, and
***************
*** 120,128 ****
  REVE CYCLIC SELECTIONS
       With the graphical versions, just below  the  eight  buttons
       are four cycle items.  These can either be selected with the
-      left mouse button, to increment  or  decrement  the  current
-      selection  (depending  upon which half on the item you click
-      over), or a selection can be made from a popup menu when you
  
  
  
--- 123,128 ----
***************
*** 137,142 ****
--- 137,145 ----
  
  
  
+      left mouse button, to increment  or  decrement  the  current
+      selection  (depending  upon which half on the item you click
+      over), or a selection can be made from a popup menu when you
       click  with  the  right mouse button (SunView and XView ver-
       sions only).  Each cycle value  has  a  keyboard  equivalent
       which  is given in brackets below.  This must be followed by
***************
*** 184,197 ****
                         tion of whether it was a good or bad move.
  
  OPTIONS
!      -b [ display ]
!           Black will be played by a human. With the  X11  variant
!           of  reve  it  is  possible  to give an optional display
!           value.
  
  
  
- 
  Sun Release 4.1   Last change: 18 October 1990                  3
  
  
--- 187,197 ----
                         tion of whether it was a good or bad move.
  
  OPTIONS
!      -animate
!           Show animation. The computer's stone will glide in from
  
  
  
  Sun Release 4.1   Last change: 18 October 1990                  3
  
  
***************
*** 203,210 ****
  
  
  
       -c   The computer will play. Presence or absence of  -b  and
!           -w options determine which piece the computer plays.
  
       -d difficulty
            The level of difficulty for  computer  moves.  See  the
--- 203,218 ----
  
  
  
+           the top left corner of the board, and when you hold the
+           left mouse button down, your stone is dragged around.
+ 
+      -b [ display ]
+           Black will be played by a human. With the  X11  variant
+           of  reve  it  is  possible  to give an optional display
+           value.
+ 
       -c   The computer will play. Presence or absence of  -b  and
!           -w options determine which stone the computer plays.
  
       -d difficulty
            The level of difficulty for  computer  moves.  See  the
***************
*** 227,240 ****
            inverse mode. This option is currently only implemented
            for the SunView version.
  
!      -l gamefile
            Load a game file. The format of this game file is given
!           below. The board will be setup with these pieces.
  
       -m   Always display in monochrome, even on a color screen.
  
!      -n   Display computer notes.
  
       -r   Save a log of computer move  information  to  the  file
            reve.res  as  the  game progresses. This information is
            probably only useful to people trying  to  improve  the
--- 235,274 ----
            inverse mode. This option is currently only implemented
            for the SunView version.
  
!      -last
!           Show where the last stone was placed, by outlining  the
!           square.
! 
!      -load gamefile
            Load a game file. The format of this game file is given
!           below. The board will be setup with these stones.
  
       -m   Always display in monochrome, even on a color screen.
  
!      -notes
!           Display computer notes.
  
+      -number
+           Show the move number on the last stone placed.
+ 
+      -quick
+           Play a quick game. Don't flash the stones as  they  are
+           being turned.
+ 
+ 
+ 
+ 
+ Sun Release 4.1   Last change: 18 October 1990                  4
+ 
+ 
+ 
+ 
+ 
+ 
+ REVE(6)                  GAMES AND DEMOS                  REVE(6)
+ 
+ 
+ 
       -r   Save a log of computer move  information  to  the  file
            reve.res  as  the  game progresses. This information is
            probably only useful to people trying  to  improve  the
***************
*** 255,274 ****
            and  XView version of reve will automatically uses this
            flag, but the X11 version will also.
  
- 
- 
- 
- Sun Release 4.1   Last change: 18 October 1990                  4
- 
- 
- 
- 
- 
- 
- REVE(6)                  GAMES AND DEMOS                  REVE(6)
- 
- 
- 
       -Wp x y
            Start the open window position at x y
  
--- 289,294 ----
***************
*** 291,297 ****
       and give the column and row. The column  letter  can  be  in
       either lower or upper case.
  
!      It is possible for one piece to have two or more  consequen-
       tive  moves,  hence  the need for the above scheme.  Reve is
       flexible about white space (except between the '<'  and  '>'
       characters).  The remarks field is ignored. The program will
--- 311,317 ----
       and give the column and row. The column  letter  can  be  in
       either lower or upper case.
  
!      It is possible for one player to have two or more consequen-
       tive  moves,  hence  the need for the above scheme.  Reve is
       flexible about white space (except between the '<'  and  '>'
       characters).  The remarks field is ignored. The program will
***************
*** 301,306 ****
--- 321,340 ----
  
  FILES
       /usr/local/lib/reve.edgetable
+ 
+ 
+ 
+ Sun Release 4.1   Last change: 18 October 1990                  5
+ 
+ 
+ 
+ 
+ 
+ 
+ REVE(6)                  GAMES AND DEMOS                  REVE(6)
+ 
+ 
+ 
            edge stability table for  all  possible  edge  combina-
            tions.
  
***************
*** 324,330 ****
  
  
  
! Sun Release 4.1   Last change: 18 October 1990                  5
  
  
  
--- 358,396 ----
  
  
  
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! Sun Release 4.1   Last change: 18 October 1990                  6
  
  
  

------- sunview.c -------
*** /tmp/da02151	Wed Nov 28 11:00:34 1990
--- sunview.c	Mon Nov 19 18:26:46 1990
***************
*** 178,183 ****
--- 178,185 ----
    int rop ;
  
    rop = opvals[(int) op] ;
+   if (!iscolor[(int) cur_dpyno] && color == C_WHITE)
+     rop = opvals[(int) RCLR] ;
    PW_VECTOR(cpw, x1, y1, x2, y2, rop | PIX_COLOR(color), 1) ;
  }
  
***************
*** 272,278 ****
    PW_PUTCOLORMAP(cpw, 0, OTH_COLORSIZE, red, green, blue) ;
    if (inv_video) PW_REVERSEVIDEO(cpw, 0, OTH_COLORSIZE) ;
  
!   if (iscolor)
      {
        frame_pw = (Pixwin *) window_get(frame, WIN_PIXWIN) ;
        PW_SETCMSNAME(frame_pw, colorname) ;
--- 274,280 ----
    PW_PUTCOLORMAP(cpw, 0, OTH_COLORSIZE, red, green, blue) ;
    if (inv_video) PW_REVERSEVIDEO(cpw, 0, OTH_COLORSIZE) ;
  
!   if (iscolor[(int) cur_dpyno])
      {
        frame_pw = (Pixwin *) window_get(frame, WIN_PIXWIN) ;
        PW_SETCMSNAME(frame_pw, colorname) ;
***************
*** 408,414 ****
  start_tool(dtype)      /* Display window and start the notifier. */
  enum disp_type dtype ;
  {
!   if (iscolor)
      {
        reve_icon = (Icon) window_get(frame, FRAME_ICON) ;
        ICON_SET(reve_icon, ICON_IMAGE, &cicon_pr, 0) ;
--- 410,416 ----
  start_tool(dtype)      /* Display window and start the notifier. */
  enum disp_type dtype ;
  {
!   if (iscolor[(int) cur_dpyno])
      {
        reve_icon = (Icon) window_get(frame, FRAME_ICON) ;
        ICON_SET(reve_icon, ICON_IMAGE, &cicon_pr, 0) ;

------- tty.c -------
*** /tmp/da02154	Wed Nov 28 11:00:35 1990
--- tty.c	Thu Nov 22 11:17:28 1990
***************
*** 349,369 ****
                    othervals[(int) PANEL_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 237 && y == 195)       /* Note message. */
      {
        draw_string(othervals[(int) EVAL_MES].column,
                    othervals[(int) EVAL_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 15 && y == 237)        /* Score message. */
      {
!       if (sscanf(str, "Black: %d, White: %d", &black, &white) == 2)
          SPRINTF(str, "Black (O): %d, White (X): %d", black, white) ;
        draw_string(othervals[(int) SCORE_MES].column,
                    othervals[(int) SCORE_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 237 && y == 237)       /* Turn message. */
      {
        draw_string(othervals[(int) TURN_MES].column,
                    othervals[(int) TURN_MES].row, str, TRUE) ;
--- 349,369 ----
                    othervals[(int) PANEL_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 15 && y == 237)       /* Note message. */
      {
        draw_string(othervals[(int) EVAL_MES].column,
                    othervals[(int) EVAL_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 15 && y == 279)        /* Score message. */
      {
!       if (sscanf(str, "Stones: Black: %d White: %d", &black, &white) == 2)
          SPRINTF(str, "Black (O): %d, White (X): %d", black, white) ;
        draw_string(othervals[(int) SCORE_MES].column,
                    othervals[(int) SCORE_MES].row, str, TRUE) ;
        return ;
      }
!   else if (x == 237 && y == 279)       /* Turn message. */
      {
        draw_string(othervals[(int) TURN_MES].column,
                    othervals[(int) TURN_MES].row, str, TRUE) ;
***************
*** 377,382 ****
--- 377,383 ----
        if (ttyvals[i].column != -1)
          {
                 if (EQUAL(str, "load"))     STRCPY(str, "Load") ;
+           else if (EQUAL(str, "moves?"))   STRCPY(str, "Moves?") ;
            else if (EQUAL(str, "save"))     STRCPY(str, "Save") ;
            else if (EQUAL(str, "show all")) STRCPY(str, "show All") ;
            draw_string(ttyvals[i].column, ttyvals[i].row, str, FALSE) ;

------- x11.c -------
*** /tmp/da02157	Wed Nov 28 11:00:36 1990
--- x11.c	Fri Nov 23 07:01:40 1990
***************
*** 29,44 ****
  #include "images.h"
  #include <sys/time.h>
  
- #ifdef SYSV
- #include <string.h>
- #else
- #include <strings.h>
- #endif /*SYSV*/
- 
  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
  #include <X11/Xatom.h>
  #include <X11/cursorfont.h>
  
  #define  BOLDFONT    "lucidasanstypewriter-bold-12"
  #define  DEFFONT     "fixed"
--- 29,40 ----
  #include "images.h"
  #include <sys/time.h>
  
  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
  #include <X11/Xatom.h>
+ #include <X11/Xos.h>
  #include <X11/cursorfont.h>
+ #include <X11/keysym.h>
  
  #define  BOLDFONT    "lucidasanstypewriter-bold-12"
  #define  DEFFONT     "fixed"
***************
*** 608,613 ****
--- 604,610 ----
  {
    XClientMessageEvent *ev ;
    XKeyPressedEvent *key_event ;
+   KeySym keysym ;
    char chs[2] ;
    int d ;
  
***************
*** 628,637 ****
                                curx = key_event->x ;
                                cury = key_event->y ;
                                (void) XLookupString(key_event, chs, 1,
!                                                    (KeySym *)  NULL,
                                                     (XComposeStatus *) NULL) ;
!                               cur_ch = chs[0] ;
!                               nextc = KEYBOARD ;
                                break ;
        case EnterNotify      : nextc = ENTER_WINDOW ;
                                break ;
--- 625,639 ----
                                curx = key_event->x ;
                                cury = key_event->y ;
                                (void) XLookupString(key_event, chs, 1,
!                                                    &keysym,
                                                     (XComposeStatus *) NULL) ;
!                               if (keysym == XK_Shift_L ||
!                                   keysym == XK_Shift_R) nextc = IGNORE_EVENT ;
!                               else
!                                 {
!                                   cur_ch = chs[0] ;
!                                   nextc = KEYBOARD ;
!                                 }
                                break ;
        case EnterNotify      : nextc = ENTER_WINDOW ;
                                break ;

------- FILES -------
*** /tmp/da02160	Wed Nov 28 11:00:37 1990
--- FILES	Wed Nov 28 10:57:53 1990
***************
*** 26,33 ****
  CHANGES                     - change history. Updated with each new patch.
  README                      - describes what reve is, and how to get started.
  TODO                        - bugs and suggested enhancements. Volunteers?
! reve.6                      - the reve manual page (troff/nroff -man format).
! reve.man                    - plain text version of the reve manual pages.
  MANIFEST                    - tells you what archive part each file was in.
  FILES                       - what you're reading now.
  reve.edge1                  - first half of the Reve edge stability table.
--- 26,33 ----
  CHANGES                     - change history. Updated with each new patch.
  README                      - describes what reve is, and how to get started.
  TODO                        - bugs and suggested enhancements. Volunteers?
! reve.man                    - the reve manual page (troff/nroff -man format).
! reve.man.text               - plain text version of the reve manual pages.
  MANIFEST                    - tells you what archive part each file was in.
  FILES                       - what you're reading now.
  reve.edge1                  - first half of the Reve edge stability table.
***************
*** 44,57 ****
  --------------------------------------------------------------------------
  images/black.icon           - black reve piece.
  images/reve.icon            - reve icon (monochrome screens and XView).
! images/reve.color.icon      - reve icon (color screens).
  images/white.icon           - white reve piece.
! images/button.invert.icon   - button panel item in inverted mode.
! images/button.normal.icon   - button panel item in normal mode.
! images/button.stencil.icon  - stencil for normal/inverted button panel items.
! images/cycle.glyph.icon     - cycle panel item in normal mode.
! images/cycle.linvert.icon   - cycle panel item with left side inverted.
! images/cycle.rinvert.icon   - cycle panel item with right side inverted.
! images/cycle.stencil.icon   - stencil for normal/inverted cycle panel items.
  images/hglass.cursor        - hour glass cursor for computer move.
  images/nocur.cursor         - no cursor when piece is being dragged.
--- 44,57 ----
  --------------------------------------------------------------------------
  images/black.icon           - black reve piece.
  images/reve.icon            - reve icon (monochrome screens and XView).
! images/Creve.icon           - reve icon (color screens).
  images/white.icon           - white reve piece.
! images/Ibutton.icon         - button panel item in inverted mode.
! images/Nbutton.icon         - button panel item in normal mode.
! images/Sbutton.icon         - stencil for normal/inverted button panel items.
! images/Ncycle.icon          - cycle panel item in normal mode.
! images/Lcycle.icon          - cycle panel item with left side inverted.
! images/Rcycle.icon          - cycle panel item with right side inverted.
! images/Scycle.icon          - stencil for normal/inverted cycle panel items.
  images/hglass.cursor        - hour glass cursor for computer move.
  images/nocur.cursor         - no cursor when piece is being dragged.

------- MANIFEST -------
*** /tmp/da02163	Wed Nov 28 11:00:38 1990
--- MANIFEST	Wed Nov 28 10:55:07 1990
***************
*** 23,32 ****
  CHANGES                                |    3
  README                                 |    3
  TODO                                   |    3
- reve.6                                 |    3
  reve.man                               |    3
  MANIFEST                               |    3
  FILES                                  |    3
  Makefile.dist                          |    3
  tty.c                                  |    4
  x11.c                                  |    4
--- 23,32 ----
  CHANGES                                |    3
  README                                 |    3
  TODO                                   |    3
  reve.man                               |    3
  MANIFEST                               |    3
  FILES                                  |    3
+ reve.man.text                          |    3
  Makefile.dist                          |    3
  tty.c                                  |    4
  x11.c                                  |    4
***************
*** 35,49 ****
  Imakefile                              |    5
  images/black.icon                      |    5
  images/reve.icon                       |    5
! images/reve.color.icon                 |    5
  images/white.icon                      |    5
! images/button.invert.icon              |    5
! images/button.normal.icon              |    5
! images/button.stencil.icon             |    5
! images/cycle.glyph.icon                |    5
! images/cycle.linvert.icon              |    5
! images/cycle.rinvert.icon              |    5
! images/cycle.stencil.icon              |    5
  images/hglass.cursor                   |    5
  images/nocur.cursor                    |    5
  reve.edge1                             |    6
--- 35,49 ----
  Imakefile                              |    5
  images/black.icon                      |    5
  images/reve.icon                       |    5
! images/Creve.icon                      |    5
  images/white.icon                      |    5
! images/Ibutton.icon                    |    5
! images/Nbutton.icon                    |    5
! images/Sbutton.icon                    |    5
! images/Ncycle.icon                     |    5
! images/Lcycle.icon                     |    5
! images/Rcycle.icon                     |    5
! images/Scycle.icon                     |    5
  images/hglass.cursor                   |    5
  images/nocur.cursor                    |    5
  reve.edge1                             |    6

------- reve.man -------
*** /tmp/da02166	Wed Nov 28 11:00:38 1990
--- reve.man	Fri Nov 23 08:47:02 1990
***************
*** 5,11 ****
  .SH SYNOPSIS
  .B "reve
  [
! .B \-b
  .I [ display ]
  ] [
  .B \-c
--- 5,13 ----
  .SH SYNOPSIS
  .B "reve
  [
! .B \-animate
! ] [
! .B \-black
  .I [ display ]
  ] [
  .B \-c
***************
*** 21,38 ****
  ] [
  .B \-i
  ] [
! .B \-l
  .I gamefile
  ] [
  .B \-m
  ] [
! .B \-n
  ] [
  .B \-r
  ] [
  .B \-v
  ] [
! .B \-w
  .I [ display ]
  ] [
  .B \-?
--- 23,46 ----
  ] [
  .B \-i
  ] [
! .B \-last
! ] [
! .B \-load
  .I gamefile
  ] [
  .B \-m
  ] [
! .B \-notes
  ] [
+ .B \-number
+ ] [
+ .B \-quick
+ ] [
  .B \-r
  ] [
  .B \-v
  ] [
! .B \-white
  .I [ display ]
  ] [
  .B \-?
***************
*** 51,64 ****
  for SunView, X11 and XView, as well as being able to function on
  normal display terminals using a termcap interface.
  .LP
! Reve is played on an 8 x 8 board, with pieces which should be considered to
  be black on one side and white on the other. A legal move consists of placing
! a piece of one's own color on the board so as to "sandwich" one or more rows
! (orthogonal or diagonal) of pieces of the opposite color between the piece
! just placed and another piece of the same color. All pieces so sandwiched are
  flipped over to reveal the color of the other side (your own color).
  .LP
! The object of the game, is to have more pieces than the opponent at
  the end of the game (ie. when the board is full or neither side has
  a legal move). If you have no legal move, you simply miss a turn.
  Black goes first.
--- 59,72 ----
  for SunView, X11 and XView, as well as being able to function on
  normal display terminals using a termcap interface.
  .LP
! Reve is played on an 8 x 8 board, with stones which should be considered to
  be black on one side and white on the other. A legal move consists of placing
! a stone of one's own color on the board so as to "sandwich" one or more rows
! (orthogonal or diagonal) of stones of the opposite color between the stone
! just placed and another stone of the same color. All stones so sandwiched are
  flipped over to reveal the color of the other side (your own color).
  .LP
! The object of the game, is to have more stones than the opponent at
  the end of the game (ie. when the board is full or neither side has
  a legal move). If you have no legal move, you simply miss a turn.
  Black goes first.
***************
*** 65,76 ****
  .LP
  With
  .I reve,
! to place one of your own pieces simply click with the mouse over the
! square in which you want your piece to go. Note that it is also possible
  to supply a number and a letter pair, to indicate where you would like your
! new piece to go. This is the only method to place pieces with the dumb tty
  interface. The square containing the last move will be shown with a black
! outline. This is updated with each new move.
  .LP
  There are various buttons and cyclic selections available. Their meanings
  are given below, plus an indication of their keyboard equivalents. With the
--- 73,86 ----
  .LP
  With
  .I reve,
! to place one of your own stones simply click with the mouse over the
! square in which you want your stone to go. Note that it is also possible
  to supply a number and a letter pair, to indicate where you would like your
! new stone to go. This is the only method to place stones with the dumb tty
  interface. The square containing the last move will be shown with a black
! outline. This is updated with each new move. If you hold the mouse button
! down as you move around the board, the square you are currently over will
! be highlighted.
  .LP
  There are various buttons and cyclic selections available. Their meanings
  are given below, plus an indication of their keyboard equivalents. With the
***************
*** 96,103 ****
  load operation. When you press the Return key, filename entry is complete,
  and the program will try to load this file. If it's unsuccessful, it will
  stop on the invalid line, and display an error message. As each line is
! successfully read from the game file, the piece is displayed on the board,
! and the appropriate pieces flipped.
  .IP "\fBmoves? [ A ]\fP" 18
  Show all the valid moves for the current board. This is useful for beginners,
  and for teaching purposes.
--- 106,113 ----
  load operation. When you press the Return key, filename entry is complete,
  and the program will try to load this file. If it's unsuccessful, it will
  stop on the invalid line, and display an error message. As each line is
! successfully read from the game file, the stone is displayed on the board,
! and the appropriate stones flipped.
  .IP "\fBmoves? [ A ]\fP" 18
  Show all the valid moves for the current board. This is useful for beginners,
  and for teaching purposes.
***************
*** 171,177 ****
  an indication of whether it was a good or bad move.
  .SH OPTIONS
  .TP
! .BI \-b " [ display ]"
  Black will be played by a human. With the X11 variant of
  .I reve
  it is possible to give an optional display value.
--- 181,192 ----
  an indication of whether it was a good or bad move.
  .SH OPTIONS
  .TP
! .B \-animate
! Show animation. The computer's stone will glide in from the top left
! corner of the board, and when you hold the left mouse button down, your
! stone is dragged around.
! .TP
! .BI \-black " [ display ]"
  Black will be played by a human. With the X11 variant of
  .I reve
  it is possible to give an optional display value.
***************
*** 178,184 ****
  .TP
  .B \-c
  The computer will play. Presence or absence of \fB\-b\fP and \fB\-w\fP
! options determine which piece the computer plays.
  .TP
  .BI \-d " difficulty"
  The level of difficulty for computer moves. See the \fBDifficulty:\fP
--- 193,199 ----
  .TP
  .B \-c
  The computer will play. Presence or absence of \fB\-b\fP and \fB\-w\fP
! options determine which stone the computer plays.
  .TP
  .BI \-d " difficulty"
  The level of difficulty for computer moves. See the \fBDifficulty:\fP
***************
*** 203,218 ****
  started their graphics environment in inverse mode. This option is
  currently only implemented for the SunView version.
  .TP
! .BI \-l " gamefile"
  Load a game file. The format of this game file is given below. The board
! will be setup with these pieces.
  .TP
  .B \-m
  Always display in monochrome, even on a color screen.
  .TP
! .B \-n
  Display computer notes.
  .TP
  .B \-r
  Save a log of computer move information to the file
  .I reve.res
--- 218,242 ----
  started their graphics environment in inverse mode. This option is
  currently only implemented for the SunView version.
  .TP
! .B \-last
! Show where the last stone was placed, by outlining the square.
! .TP
! .BI \-load " gamefile"
  Load a game file. The format of this game file is given below. The board
! will be setup with these stones.
  .TP
  .B \-m
  Always display in monochrome, even on a color screen.
  .TP
! .B \-notes
  Display computer notes.
  .TP
+ .B \-number
+ Show the move number on the last stone placed.
+ .TP
+ .B \-quick
+ Play a quick game. Don't flash the stones as they are being turned.
+ .TP
  .B \-r
  Save a log of computer move information to the file
  .I reve.res
***************
*** 229,235 ****
  .I reve
  program.
  .TP
! .BI \-w " [ display ]"
  White will be played by a human. With the X11 variant of
  .I reve
  it is possible to give an optional display value.
--- 253,259 ----
  .I reve
  program.
  .TP
! .BI \-white " [ display ]"
  White will be played by a human. With the X11 variant of
  .I reve
  it is possible to give an optional display value.
***************
*** 265,271 ****
  give the column and row. The column letter can be in either lower or
  upper case.
  .LP
! It is possible for one piece to have two or more consequentive moves, hence
  the need for the above scheme.
  .I Reve
  is flexible about white space (except between the '<' and '>' characters).
--- 289,295 ----
  give the column and row. The column letter can be in either lower or
  upper case.
  .LP
! It is possible for one player to have two or more consequentive moves, hence
  the need for the above scheme.
  .I Reve
  is flexible about white space (except between the '<' and '>' characters).

------- reve.edge1 -------
*** /tmp/da02170	Wed Nov 28 11:00:40 1990
--- reve.edge1	Fri Nov 23 06:44:36 1990
***************
*** 728,734 ****
  edges[ 727] =   -2439 [ -xxxxxoo ]
  edges[ 728] =    4036 [ xxxxxxoo ]
  edges[ 729] =   -7641 [ oooooo-o ]
! edges[ 730] =   -1166 [ -ooooo-o ]
  edges[ 731] =      34 [ xooooo-o ]
  edges[ 732] =   -2436 [ o-oooo-o ]
  edges[ 733] =   -1236 [ --oooo-o ]
--- 728,734 ----
  edges[ 727] =   -2439 [ -xxxxxoo ]
  edges[ 728] =    4036 [ xxxxxxoo ]
  edges[ 729] =   -7641 [ oooooo-o ]
! edges[ 730] =    4000 [ -ooooo-o ]
  edges[ 731] =      34 [ xooooo-o ]
  edges[ 732] =   -2436 [ o-oooo-o ]
  edges[ 733] =   -1236 [ --oooo-o ]

------- reve.edge2 -------
*** /tmp/da02173	Wed Nov 28 11:00:42 1990
--- reve.edge2	Fri Nov 23 06:44:56 1990
***************
*** 548,554 ****
  edges[2187] =   -7571 [ ooooooo- ]
  edges[2188] =     -80 [ -oooooo- ]
  edges[2189] =    1304 [ xoooooo- ]
! edges[2190] =   -1166 [ o-ooooo- ]
  edges[2191] =     100 [ --ooooo- ]
  edges[2192] =    1234 [ x-ooooo- ]
  edges[2193] =    1434 [ oxooooo- ]
--- 548,554 ----
  edges[2187] =   -7571 [ ooooooo- ]
  edges[2188] =     -80 [ -oooooo- ]
  edges[2189] =    1304 [ xoooooo- ]
! edges[2190] =    4000 [ o-ooooo- ]
  edges[2191] =     100 [ --ooooo- ]
  edges[2192] =    1234 [ x-ooooo- ]
  edges[2193] =    1434 [ oxooooo- ]

------- Imakefile -------
*** /tmp/da02176	Wed Nov 28 11:00:43 1990
--- Imakefile	Mon Nov 12 16:46:01 1990
***************
*** 79,86 ****
  		  procs.o rev_eval.o rev_ip.o rev_iycp.o x11.o
  
  ComplexProgramTarget(reve)
! MakeDirectories(install,$(LIBDIR))
! InstallNonExec($(ETABLE),$(LIBDIR))
  
  install:: install.man
  
--- 79,86 ----
  		  procs.o rev_eval.o rev_ip.o rev_iycp.o x11.o
  
  ComplexProgramTarget(reve)
! MakeDirectories(install,$(LIBDIR)$(PATHSEP)reve)
! InstallNonExec($(ETABLE),$(LIBDIR)$(PATHSEP)reve)
  
  install:: install.man
  

eddie@sjrpp.UUCP (Eddie Turner SJRPP TSD) (12/07/90)

I missed patch 1 for reve. If anyone still has it please mail.
Thanks,
Eddie
UUCP path from gatech ...!gatech!uforida!unf7!sjrpp!eddie

-- 
Eddie Turner                            UUCP:...gatech!uflorida!unf7!sjrpp!eddie
St. Johns River Power Park ---------------------- Technical Services Deptartment
Jacksonville, FL 32226                                       PHONE:(904)751-7835