home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume11
/
reve
/
patch1a
/
patches01a
next >
Wrap
Text File
|
1990-12-11
|
44KB
|
1,243 lines
------- patchlevel.h -------
Prereq: 0
*** /tmp/da28531 Fri Nov 9 10:13:21 1990
--- patchlevel.h Mon Nov 5 09:06:16 1990
***************
*** 6,16 ****
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is given to distribute these sources, as long as the
! * introductory messages are not removed, and no monies are exchanged.
*
! * You are forbidden from using Reve as is, or in a modified state, in
! * any tournaments, without the permission of the authors.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
--- 6,21 ----
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is granted to copy this source, for redistribution
! * in source 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 source, without the
! * news headers, for the purposes of 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.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
***************
*** 17,20 ****
* (see README file), then an attempt will be made to fix them.
*/
! #define PATCHLEVEL 0
--- 22,25 ----
* (see README file), then an attempt will be made to fix them.
*/
! #define PATCHLEVEL 1
*** /dev/null Fri Nov 9 10:01:02 1990
--- Imakefile Fri Nov 9 10:15:13 1990
***************
*** 0 ****
--- 1,88 ----
+
+ /* @(#)Imakefile 1.2 90/11/09
+ *
+ * Copyright (C) 1990 - Rich Burridge & Yves Gallot.
+ * All rights reserved.
+ *
+ * Permission is granted to copy this source, for redistribution
+ * in source 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 source, without the
+ * news headers, for the purposes of 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.
+ *
+ * No responsibility is taken for any errors inherent either
+ * to the comments or the code of this program, but if reported
+ * (see README file), then an attempt will be made to fix them.
+ *
+ *------------------------------------------------------------------------
+ * There are various small changes needed when compiling reve on
+ * different systems. These have been isolated here, and should be
+ * uncommented if needed.
+ *
+ *
+ * Not every version of Unix (in particular System V derivitives) has the
+ * select() system call. If your machine doesn't have this call, then you
+ * need to uncomment the following definition.
+ *
+ *NOSELECT = -DNOSELECT
+ *
+ *
+ * Some machines do not have the usleep library function. If this is
+ * true, then you will need to uncomment this definition.
+ *
+ *NO_USLEEP = -DNO_USLEEP
+ */
+
+ #ifdef UltrixArchitecture
+ NO_USLEEP = -DNO_USLEEP
+ #endif
+
+ /* 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.
+ *
+ *SELTYPE = -DNO_43SELECT
+ */
+
+
+ /* YOU SHOULD NOT NEED TO MODIFY ANYTHING BELOW HERE. */
+
+ #if HasVoidSignalReturn == NO
+ SIGRET = -DINT_SIGNAL
+ #endif
+
+ /* Compilation flags and standard macro definitions. */
+
+ SYS_LIBRARIES = $(XLIB)
+ CDEFS = $(NOSELECT) $(NO_USLEEP) $(EDGENAME) $(SELTYPE) \
+ $(SIGRET)
+ DEFINES = $(CDEFS) -DX11
+ ETABLE = reve.edgetable
+ LIBDIR = $(USRLIBDIR)/reve
+
+ /*
+ * Full pathname of the reve edge table file. This can also be overridden
+ * with a command line option.
+ */
+ EDGENAMEFILE = $(LIBDIR)/$(ETABLE)
+ EDGENAME = -DEDGENAME=\"$(EDGENAMEFILE)\"
+
+
+ SRCS = boardstuff.c events.c items.c makemove.c main.c \
+ procs.c rev_eval.c rev_ip.c rev_iycp.c x11.c
+ OBJS = boardstuff.o events.o items.o makemove.o main.o \
+ procs.o rev_eval.o rev_ip.o rev_iycp.o x11.o
+
+ ComplexProgramTarget(reve)
+ MakeDirectories(install,$(LIBDIR))
+ InstallNonExec($(ETABLE),$(LIBDIR))
+
+ install:: install.man
+
+ $(ETABLE): reve.edge1 reve.edge2
+ cat reve.edge1 reve.edge2 > $(ETABLE)
------- CHANGES -------
*** /tmp/da28687 Fri Nov 9 10:24:57 1990
--- CHANGES Fri Nov 9 10:17:27 1990
***************
*** 4,14 ****
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is given to distribute these sources, as long as the
! * introductory messages are not removed, and no monies are exchanged.
*
! * You are forbidden from using Reve as is, or in a modified state, in
! * any tournaments, without the permission of the authors.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
--- 4,19 ----
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is granted to copy this source, for redistribution
! * in source 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 source, without the
! * news headers, for the purposes of 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.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
***************
*** 17,22 ****
--- 22,144 ----
Reve change history.
====================
+
+ v1.1 - patchlevel 1. 9th November 1990.
+
+ * Time allocation function was out by 1. All the levels are shifted
+ by 1. This explains why computer move selection at level 1 is so
+ "slow".
+
+ * The sandwich routine in makemove.c, was accessing out of bounds
+ elements in the square array.
+
+ * The play_reve routine in rev_ip.c, was accessing out-of bounds
+ elements in the cpi, cpj and cpk arrays.
+
+ * black_dpy and white_dpy were declared inconsistently in main.c and
+ extern.h
+
+ * If you select White->human, then Black->computer, Reve correctly
+ plays the black computer move. If you then select Black->human
+ followed by White->computer, Reve incorrectly made another move
+ for black. There was a similar problem when starting a new game
+ with Black being played by computer.
+
+ * Fixed up a few other inconsistencies found by Saber-C.
+
+ * Extraction of the optional X11 display names for the -b and -w
+ options in get_options() was incorrect.
+
+ * If you used the suggest button, to get the computer to suggest a
+ move, it was decrementing the time allowed for the computer.
+
+ * Adjusted entries 2191 and 2917 of the Reve edge stability table
+ (in reve.edge2).
+
+ * Added in the code for a new tree algorithm from Yves (rev_eval.c
+ and rev_ip.c).
+
+ * Added a -r command line option, which will write some computer
+ move information to a reve.res file after each computer move. This
+ is probably only of use to people trying to improve the computer
+ algorithm. The manual pages has been updated.
+
+ * The computer move timing function in rev_ip.c now uses an alarm and
+ signal, so should be independent of the machine it's running on.
+
+ * Changed the variable "depth" to "level". As Reve now uses a timing
+ function to calculate it's computer moves, "depth" is not a true
+ indication of depth.
+
+ * Changed all #include <strings.h> to #include string.h or strings.h
+ depending upon whether SYSV was defined.
+
+ * The amount of computer time left for moves is now stored for each
+ move, so that if a move is undone against the computer, the previous
+ time left value is restored.
+
+ * Added in a -m command line line, which will start up Reve in
+ monochrome only, even on a color screen.
+
+ * The last move made is now shown by putting a black square around
+ the piece on the board. This is updated when a new move is made. The
+ manual pages have been changed to mention this.
+
+ * The "last" panel button has been replaced with a "moves?" panel
+ button (and rearranged to be alphabetical), which displays all the
+ valid moves at any particular time. This is very useful for
+ beginners and for teaching purposes. The manual pages have been
+ updated to reflect these changes.
+
+ * Added in more hooks for two screen support for the X11 version.
+
+ * From Jonathan I. Kamens <jik@pit-manager.MIT.EDU>
+ - Supplied a standard Imakefile for use with the X11 version of reve.
+ The Imakefile expects the manual pages in (nroff'able format) to
+ be in a file called reve.man, so reve.man needs to be renamed to
+ reve.man.text, and reve.6 needs to be renamed to reve.man. This is
+ detailed explicitly at the beginning of the instructions on how to
+ apply this patch.
+
+ - If X11 is defined (It's defined in the Imake-generated Makefile),
+ then include <X11/Xos.h>. That file does the index/strchr frobbing
+ automatically. Affects boardstuff.c and main.c
+
+ - Removed the definition of FREAD in reve.h. Some systems use
+ FREAD as a constant in /usr/include/sys/file.h. Incidentally,
+ it was no longer needed.
+
+ - Only do the index/strchr frobbing if X11 isn't defined. Change
+ to reve.h
+
+ - As far as I know, void-returning signal handlers are NOT part of
+ standard BSD4.3, so your #ifdef name for that is a bit wrong.
+ This name has been changed to INT_SIGNAL, and all the appropriate
+ files updated.
+
+ * Included a new XView version of Reve from Valerie Haecky. Adjusted
+ the "generic" sources to handle this. This involved moving
+ draw_piece and draw_rect into boardstuff.c, and *not* including
+ items.c when compiling the XView version. The XView version needs a
+ -DXVIEW flag to correct setup five #defines in reve.h. The
+ Makefile.dist has been updated to handle all this.
+
+ * The introductory messages in each file have been changed to try to
+ state our wishes in the correct manner.
+
+ * From Krishnamurthy Ganesan <ganesan@cs.fau.edu>
+ The processing of the readmask in the Xselect_input() routine in
+ x11.c was incorrect for the non-BSD4.3 option. The parentheses
+ were misplaced in two lines.
+
+ * From Gordon C. Galligher <telxon!ping!source@uunet.UU.NET>
+ Several icons in the images sub-directory have had their names
+ changed to less than 14 characters, so that they can work on
+ System V machines.
+
+ * There was an offset problem when drawing the inverted piece
+ for the first time on a mouse down. This was before it was
+ dragged around.
v1.1 - patchlevel 0. 22nd October 1990.
------- Makefile.dist -------
*** /tmp/da28690 Fri Nov 9 10:24:58 1990
--- Makefile.dist Thu Nov 8 10:35:39 1990
***************
*** 6,16 ****
# Copyright (C) 1990 - Rich Burridge & Yves Gallot.
# All rights reserved.
#
! # Permission is given to distribute these sources, as long as the
! # introductory messages are not removed, and no monies are exchanged.
#
! # You are forbidden from using Reve as is, or in a modified state, in
! # any tournaments, without the permission of the authors.
#
# No responsibility is taken for any errors inherent either
# to the comments or the code of this program, but if reported
--- 6,21 ----
# Copyright (C) 1990 - Rich Burridge & Yves Gallot.
# All rights reserved.
#
! # Permission is granted to copy this source, for redistribution
! # in source 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 source, without the
! # news headers, for the purposes of 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.
#
# No responsibility is taken for any errors inherent either
# to the comments or the code of this program, but if reported
***************
*** 52,63 ****
#
#SELTYPE = -DNO_43SELECT
#-----------------------------------------------------------------------
! # If you are not running under a BSD4.3 derived system, then the
! # second parameter to a signal call is a pointer to an integer function,
! # and this definition needs to be uncommented. You need to uncomment this
! # for SunOS v3.x.
#
! #SIGRET = -DNO_4_3SIGNAL
#-----------------------------------------------------------------------
# If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
# SVAT, or Xenix286, then you will need to uncomment this definition.
--- 57,67 ----
#
#SELTYPE = -DNO_43SELECT
#-----------------------------------------------------------------------
! # If you are running on a system, where the second parameter to a signal
! # call is a pointer to an integer function, then this definition needs
! # to be uncommented.
#
! #SIGRET = -DINT_SIGNAL
#-----------------------------------------------------------------------
# If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
# SVAT, or Xenix286, then you will need to uncomment this definition.
***************
*** 75,81 ****
# If you are compiling the XView version, then the following two lines
# should be uncommented, and set appropriately.
#
! #XVIEWINCDIR = -I$(OPENWINHOME)/include
#XVIEWLIBDIR = -L$(OPENWINHOME)/lib
#
#===========================================================================
--- 79,85 ----
# If you are compiling the XView version, then the following two lines
# should be uncommented, and set appropriately.
#
! #XVIEWINCDIR = -I$(OPENWINHOME)/include -DXVIEW
#XVIEWLIBDIR = -L$(OPENWINHOME)/lib
#
#===========================================================================
***************
*** 96,109 ****
#
#==========================================================================
BINARIES = sv_reve tty_reve xreve xv_reve
ETABLE = reve.edgetable
CC = cc
! STDSRCS = boardstuff.c events.c items.c makemove.c main.c \
procs.c rev_eval.c rev_ip.c rev_iycp.c
! STDOBJS = boardstuff.o events.o items.o makemove.o main.o \
procs.o rev_eval.o rev_ip.o rev_iycp.o
GSRCS = sunview.c tty.c x11.c xview.c
--- 100,115 ----
#
#==========================================================================
+ .KEEP_STATE:
+
BINARIES = sv_reve tty_reve xreve xv_reve
ETABLE = reve.edgetable
CC = cc
! STDSRCS = boardstuff.c events.c makemove.c main.c \
procs.c rev_eval.c rev_ip.c rev_iycp.c
! STDOBJS = boardstuff.o events.o makemove.o main.o \
procs.o rev_eval.o rev_ip.o rev_iycp.o
GSRCS = sunview.c tty.c x11.c xview.c
***************
*** 111,125 ****
IDIR = images
IMAGES = $(IDIR)/black.icon \
$(IDIR)/reve.icon \
! $(IDIR)/reve.color.icon \
$(IDIR)/white.icon \
! $(IDIR)/button.invert.icon \
! $(IDIR)/button.normal.icon \
! $(IDIR)/button.stencil.icon \
! $(IDIR)/cycle.glyph.icon \
! $(IDIR)/cycle.linvert.icon \
! $(IDIR)/cycle.rinvert.icon \
! $(IDIR)/cycle.stencil.icon \
$(IDIR)/hglass.cursor \
$(IDIR)/nocur.cursor
--- 117,131 ----
IDIR = images
IMAGES = $(IDIR)/black.icon \
$(IDIR)/reve.icon \
! $(IDIR)/Creve.icon \
$(IDIR)/white.icon \
! $(IDIR)/Ibutton.icon \
! $(IDIR)/Nbutton.icon \
! $(IDIR)/Sbutton.icon \
! $(IDIR)/Ncycle.icon \
! $(IDIR)/Lcycle.icon \
! $(IDIR)/Rcycle.icon \
! $(IDIR)/Scycle.icon \
$(IDIR)/hglass.cursor \
$(IDIR)/nocur.cursor
***************
*** 130,136 ****
SFILES2 = boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
SFILES3 = $(OTHERS)
SFILES4 = tty.c x11.c xview.c
! SFILES5 = sunview.c $(IDIR)
SFILES6 = reve.edge1
SFILES7 = reve.edge2
--- 136,142 ----
SFILES2 = boardstuff.c rev_eval.c rev_ip.c rev_iycp.c $(HDRS)
SFILES3 = $(OTHERS)
SFILES4 = tty.c x11.c xview.c
! SFILES5 = sunview.c $(IDIR) Imakefile
SFILES6 = reve.edge1
SFILES7 = reve.edge2
***************
*** 156,171 ****
all: $(BINARIES)
! sunview: $(STDOBJS) sunview.o
! $(CC) -o sv_reve $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
-cp sv_reve reve
! tty: $(STDOBJS) tty.o
! $(CC) -o tty_reve $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
-cp tty_reve reve
! x11: $(STDOBJS) x11.o
! $(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) x11.o \
$(X11LIBS)
-cp xreve reve
--- 162,180 ----
all: $(BINARIES)
! sunview: $(STDOBJS) items.o sunview.o
! $(CC) -o sv_reve $(CFLAGS) $(STDOBJS) \
! items.o sunview.o $(SVIEWLIBS)
-cp sv_reve reve
! tty: $(STDOBJS) items.o tty.o
! $(CC) -o tty_reve $(CFLAGS) $(STDOBJS) \
! items.o tty.o $(TTYLIBS)
-cp tty_reve reve
! x11: $(STDOBJS) items.o x11.o
! $(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) \
! items.o x11.o \
$(X11LIBS)
-cp xreve reve
***************
*** 187,199 ****
clean:; rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core
lint: lint-sunview lint-tty lint-xview lint-x11
! lint-sunview:; lint $(CDEFS) $(STDSRCS) sunview.c $(SVIEWLIBS)
! lint-tty:; lint $(CDEFS) $(STDSRCS) tty.c $(TTYLIBS)
lint-xview:; lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS)
! lint-x11:; lint $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
saber: $(STDSRCS) x11.c
! #load $(LDFLAGS) $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
shar:; shar.script $(SFILES1) > Part1
shar.script $(SFILES2) > Part2
--- 196,208 ----
clean:; rm -f *.o *.Z *.uu Part* *~ reve $(BINARIES) core
lint: lint-sunview lint-tty lint-xview lint-x11
! lint-sunview:; lint $(CDEFS) $(STDSRCS) items.c sunview.c $(SVIEWLIBS)
! lint-tty:; lint $(CDEFS) $(STDSRCS) items.c tty.c $(TTYLIBS)
lint-xview:; lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS)
! lint-x11:; lint $(CDEFS) $(STDSRCS) items.c x11.c $(X11LIBS)
saber: $(STDSRCS) x11.c
! #load $(LDFLAGS) $(CDEFS) $(STDSRCS) items.c x11.c $(X11LIBS)
shar:; shar.script $(SFILES1) > Part1
shar.script $(SFILES2) > Part2
***************
*** 204,210 ****
shar.script $(SFILES7) > Part7
create: SCCS
! -sccs create $(STDSRCS) $(GSRCS) $(HDRS) $(IMAGES) $(OTHERS)
SCCS:
mkdir SCCS
--- 213,220 ----
shar.script $(SFILES7) > Part7
create: SCCS
! -sccs create $(STDSRCS) items.c $(GSRCS) $(HDRS) \
! $(IMAGES) $(OTHERS)
SCCS:
mkdir SCCS
------- README -------
*** /tmp/da28693 Fri Nov 9 10:24:59 1990
--- README Wed Nov 7 11:41:54 1990
***************
*** 4,14 ****
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is given to distribute these sources, as long as the
! * introductory messages are not removed, and no monies are exchanged.
*
! * You are forbidden from using Reve as is, or in a modified state, in
! * any tournaments, without the permission of the authors.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
--- 4,19 ----
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is granted to copy this source, for redistribution
! * in source 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 source, without the
! * news headers, for the purposes of 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.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
***************
*** 187,193 ****
Steve Misrack, Hugues Leroy, Linton Miller, Mike Stump, D. Hugh Redelmeier,
Scott W. Danielson, Gary D. Kline, Kjetil Torgrim Homme, Peter Johansson,
Alfred Nathaniel, Arnold Gill, Martin Chudley, W Mat Waites, Keith Moore,
! John Eras and Heather Rose for bug reports and/or bug fixes plus suggested
enhancements.
Suggestions for furthur improvement would be most welcome, plus bugs,
--- 192,199 ----
Steve Misrack, Hugues Leroy, Linton Miller, Mike Stump, D. Hugh Redelmeier,
Scott W. Danielson, Gary D. Kline, Kjetil Torgrim Homme, Peter Johansson,
Alfred Nathaniel, Arnold Gill, Martin Chudley, W Mat Waites, Keith Moore,
! John Eras, Heather Rose, Jonathan I. Kamens, Krishnamurthy Ganesan and
! Gordon C. Galligher for bug reports and/or bug fixes plus suggested
enhancements.
Suggestions for furthur improvement would be most welcome, plus bugs,
------- TODO -------
*** /tmp/da28696 Fri Nov 9 10:24:59 1990
--- TODO Fri Nov 9 09:38:18 1990
***************
*** 4,14 ****
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is given to distribute these sources, as long as the
! * introductory messages are not removed, and no monies are exchanged.
*
! * You are forbidden from using Reve as is, or in a modified state, in
! * any tournaments, without the permission of the authors.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
--- 4,19 ----
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is granted to copy this source, for redistribution
! * in source 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 source, without the
! * news headers, for the purposes of 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.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
***************
*** 20,37 ****
1/ Finish off the X11 "two screens on two machines" version. The hooks are
all in place, but not enough spare time...
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>
! 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 things, like
! how Difficulty is measured.
! 4/ With the XView version, 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, the server will hang.
! 5/ The color icon doesn't display properly with the XView version.
--- 25,143 ----
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.
+ ~ In the process_event routine, only allow the FRAME_REPAINT event
+ through if it's now this persons go. Otherwise output a panel message
+ telling the user to wait her/his turn.
+ ~ Changing the Black: and White: cyclic items should have a null effect
+ if dtype is XTWO. Output a message to this effect.
+ ~ If dtype is XTWO, then message and draw_piece should output to both
+ 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,
! the server will hang.
! ~ The game panel doesn't correct repaint itself. You need to select
! "Refresh" from the frame menu.
! ~ The hourglass cursor should be drawn in XOR mode.
! ~ The board window should not have a window menu.
! ~ The game board isn't correctly painted with the -m command line option.
! ~ When you click to get the panel window to the top, the game board should
! also be raised.
! ~ The alignment and size of some of the items needs to be adjusted to be
! more consistent.
! ~ The color icon doesn't get displayed properly.
! ~ Would be nice to be able to close the game panel and leave the board
! window open. Status information could be written to a title line and a
! window footer (messages such as the number of stones each player
! 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.
------- boardstuff.c -------
*** /tmp/da28701 Fri Nov 9 10:25:30 1990
--- boardstuff.c Fri Nov 9 08:57:42 1990
***************
*** 7,17 ****
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is given to distribute these sources, as long as the
! * introductory messages are not removed, and no monies are exchanged.
*
! * You are forbidden from using Reve as is, or in a modified state, in
! * any tournaments, without the permission of the authors.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
--- 7,22 ----
* Copyright (C) 1990 - Rich Burridge & Yves Gallot.
* All rights reserved.
*
! * Permission is granted to copy this source, for redistribution
! * in source 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 source, without the
! * news headers, for the purposes of 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.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
***************
*** 18,35 ****
* (see README file), then an attempt will be made to fix them.
*/
! #include <stdio.h>
#include <ctype.h>
-
- #ifndef SYSV
#include <sys/time.h>
- #endif /*SYSV*/
! #include "color.h"
! #include "reve.h"
! #include "extern.h"
-
void
animate_move(move)
int move ;
--- 23,38 ----
* (see README file), then an attempt will be made to fix them.
*/
! #include "reve.h"
! #include "color.h"
! #include "extern.h"
#include <ctype.h>
#include <sys/time.h>
! #ifdef X11
! #include <X11/Xos.h>
! #endif /*X11*/
void
animate_move(move)
int move ;
***************
*** 50,56 ****
{
#ifndef SYSV
set_timer() ;
! #endif /*SYSV*/
x0 = x ;
y0 = y ;
x += move_delta ;
--- 53,59 ----
{
#ifndef SYSV
set_timer() ;
! #endif /*!SYSV*/
x0 = x ;
y0 = y ;
x += move_delta ;
***************
*** 63,69 ****
draw_piece(WHITE, x0, CY+y0, RINV) ;
#ifndef SYSV
nap_upto(1) ;
! #endif /*SYSV*/
}
draw_piece(WHITE, x, CY+y, RINV) ;
}
--- 66,72 ----
draw_piece(WHITE, x0, CY+y0, RINV) ;
#ifndef SYSV
nap_upto(1) ;
! #endif /*!SYSV*/
}
draw_piece(WHITE, x, CY+y, RINV) ;
}
***************
*** 77,83 ****
{
#ifndef SYSV
set_timer() ;
! #endif /*SYSV*/
x0 = x ;
y0 = y ;
y += move_delta ;
--- 80,86 ----
{
#ifndef SYSV
set_timer() ;
! #endif /*!SYSV*/
x0 = x ;
y0 = y ;
y += move_delta ;
***************
*** 90,96 ****
draw_piece(WHITE, x0, CY+y0, RINV) ;
#ifndef SYSV
nap_upto(1) ;
! #endif /*SYSV*/
}
draw_piece(WHITE, x, CY+y, RINV) ;
}
--- 93,99 ----
draw_piece(WHITE, x0, CY+y0, RINV) ;
#ifndef SYSV
nap_upto(1) ;
! #endif /*!SYSV*/
}
draw_piece(WHITE, x, CY+y, RINV) ;
}
***************
*** 112,118 ****
who_wins() ;
last_cmode = cmode ; /* Save previous value in case of undo. */
cmode = GAME_OVER ;
! message(PANEL_MES, "Game over") ;
return(FALSE) ;
}
if ((move = valid_move(&board, player)) == FALSE)
--- 115,121 ----
who_wins() ;
last_cmode = cmode ; /* Save previous value in case of undo. */
cmode = GAME_OVER ;
! message(PANEL_MES, "***GAME OVER***") ;
return(FALSE) ;
}
if ((move = valid_move(&board, player)) == FALSE)
***************
*** 126,132 ****
who_wins() ;
last_cmode = cmode ;
cmode = GAME_OVER ;
! message(PANEL_MES, "Game over") ;
}
return(FALSE) ;
}
--- 129,135 ----
who_wins() ;
last_cmode = cmode ;
cmode = GAME_OVER ;
! message(PANEL_MES, "***GAME OVER***") ;
}
return(FALSE) ;
}
***************
*** 148,153 ****
--- 151,157 ----
else
{
if (cmode != GAME_OVER) cmode = (enum cantype) ((int) cmode - 1) ;
+ next_player = OPPONENT(next_player) ;
return ;
}
}
***************
*** 180,185 ****
--- 184,216 ----
}
+ void
+ draw_piece(piece, x, y, op) /* Draw an othello piece on the board. */
+ int piece, x, y ;
+ enum optype op ;
+ {
+ switch (piece)
+ {
+ case BLACK : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
+ P_BLACK, P_BLACK) ;
+ break ;
+ case WHITE : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
+ P_BLACK, P_WHITE) ;
+ }
+ }
+
+
+ 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) ;
+ draw_line(x2, y1, x2, y2, op, color) ;
+ draw_line(x1, y2, x2, y2, op, color) ;
+ }
+
+
formfliplist(move, player)
int move, player ;
{
***************
*** 196,201 ****
--- 227,233 ----
moves[n].move = move ;
moves[n].note = note ;
moves[n].player = player ;
+ moves[n].timeleft = timeleft ;
cnt = count(&board, player) ;
return(cnt - old_cnt - 1) ;
***************
*** 263,269 ****
initboard() ;
last_move = -1 ;
init_canvas() ;
! message(NOTES_MES, "") ;
while (fgets(buf, MAXLINE, fp) != NULL)
{
if (buf[0] == '\n' || buf[0] == '#') continue ;
--- 295,301 ----
initboard() ;
last_move = -1 ;
init_canvas() ;
! message(EVAL_MES, "") ;
while (fgets(buf, MAXLINE, fp) != NULL)
{
if (buf[0] == '\n' || buf[0] == '#') continue ;
***************
*** 286,292 ****
if (lptr < mptr) next_player = BLACK ; /* Black move? */
else next_player = WHITE ;
SSCANF(lptr, "<%c-%c>", &row, &col) ;
! if (load_move(moveno, row, col) == 0)
{
SPRINTF(buf, "Load error: invalid move <%c-%c> on line %d",
row, col, move) ;
--- 318,324 ----
if (lptr < mptr) next_player = BLACK ; /* Black move? */
else next_player = WHITE ;
SSCANF(lptr, "<%c-%c>", &row, &col) ;
! if (load_move(row, col) == 0)
{
SPRINTF(buf, "Load error: invalid move <%c-%c> on line %d",
row, col, move) ;
***************
*** 309,318 ****
}
! load_move(n, col, row)
! int n, col, row ;
{
! int i, taken, x, y ;
if (row < '1' || row > '8') return(0) ;
if (isupper(col)) col = tolower(col) ;
--- 341,350 ----
}
! load_move(col, row)
! int col, row ;
{
! int i, x, y ;
if (row < '1' || row > '8') return(0) ;
if (isupper(col)) col = tolower(col) ;
***************
*** 319,325 ****
if (col < 'a' || col > 'h') return(0) ;
move = (row - '1') * BOARD_SIZE + (col - 'a') ;
if (legal(move, next_player, &board) == FALSE) return(0) ;
! taken = formfliplist(move, next_player) ;
batch(IS_ON) ;
FOR_BOARD(i)
if (board.square[i] != old_board.square[i])
--- 351,357 ----
if (col < 'a' || col > 'h') return(0) ;
move = (row - '1') * BOARD_SIZE + (col - 'a') ;
if (legal(move, next_player, &board) == FALSE) return(0) ;
! (void) formfliplist(move, next_player) ;
batch(IS_ON) ;
FOR_BOARD(i)
if (board.square[i] != old_board.square[i])
***************
*** 347,353 ****
if (elapsed > n) return ;
usleep((unsigned) (n - elapsed)) ;
}
! #endif /*SYSV*/
void
--- 379,385 ----
if (elapsed > n) return ;
usleep((unsigned) (n - elapsed)) ;
}
! #endif /*!SYSV*/
void
***************
*** 399,405 ****
void
set_score()
{
! SPRINTF(line, "Black: %2d, White: %2d",
count(&board, BLACK), count(&board, WHITE)) ;
message(SCORE_MES, line) ;
}
--- 431,437 ----
void
set_score()
{
! SPRINTF(line, "Stones: Black: %2d White: %2d",
count(&board, BLACK), count(&board, WHITE)) ;
message(SCORE_MES, line) ;
}
***************
*** 422,431 ****
GETTIMEOFDAY(&tp, &tzp) ;
}
! #endif /*SYSV*/
void
show_suggestion()
{
enum optype rop ;
--- 454,528 ----
GETTIMEOFDAY(&tp, &tzp) ;
}
! #endif /*!SYSV*/
void
+ show_all(state)
+ enum bltype state ;
+ {
+ int color, d, i, x, y ;
+
+ d = (int) cur_dpyno ;
+ batch(IS_ON) ;
+ if (state == IS_ON)
+ {
+ FOR_BOARD(i) s_all.square[i] = FREE ;
+ FOR_BOARD(i)
+ if (board.square[i] == FREE && legal(i, next_player, &board))
+ {
+ s_all.square[i] = next_player ;
+ if (iscolor[d])
+ {
+ get_xy(i, &x, &y) ;
+ draw_stencil(x, CY+y, PSIZE, PSIZE, RSRC, C_BLACK,
+ P_WHITE, P_WHITE) ;
+ }
+ else
+ {
+ x = BBORDER + ((i & 7) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
+ y = BBORDER + ((i >> 3) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
+ draw_line(x-5, CY+y, x+5, CY+y, RSRC, C_BLACK) ;
+ draw_line(x, CY+y+5, x, CY+y-5, RSRC, C_BLACK) ;
+ }
+ }
+ }
+ else
+ {
+ FOR_BOARD(i)
+ if (s_all.square[i] != FREE)
+ {
+ s_all.square[i] = FREE ;
+ x = (i & 7) * CELL_SIZE + BBORDER + 1 ;
+ y = (i >> 3) * CELL_SIZE + BBORDER + 1 ;
+ color = (iscolor[d]) ? C_LBROWN : C_WHITE ;
+ color_area(x, CY + y, CELL_SIZE - 2, CELL_SIZE - 2, color) ;
+ }
+ }
+ batch(IS_OFF) ;
+ show_moves = (int) state ;
+ }
+
+
+ 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) ;
+ }
+
+
+ void
show_suggestion()
{
enum optype rop ;
***************
*** 450,455 ****
--- 547,554 ----
{
int flips, i, piece, x, y ;
+ show_all(IS_OFF) ;
+ show_last(last_move, IS_OFF) ;
show_suggestion() ;
for (flips = 0; flips < 4; flips++)
{
***************
*** 468,473 ****
--- 567,574 ----
batch(IS_OFF) ;
PAUSE ;
}
+ show_last(move, IS_ON) ;
+ last_move = move ;
set_score() ;
set_turn(OPPONENT(player)) ;
message(TURN_MES, line) ;
***************
*** 475,484 ****
if ((player == BLACK && items[(int) BLACK_PLAYS].value == COMPUTER) ||
(player == WHITE && items[(int) WHITE_PLAYS].value == COMPUTER))
{
! SPRINTF(line, "%s: <%c-%c> note : %ld",
(player == BLACK) ? "Black" : "White",
(move & 7) + 'a', (move >> 3) + '1', note) ;
! message(NOTES_MES, line) ;
}
}
--- 576,585 ----
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) ;
}
}