home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v13i097: gnuchess4 - GNU Chess 4.0, Part09/12
- Message-ID: <3064@master.CNA.TEK.COM>
- Date: 19 Jun 92 15:55:04 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 1537
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: cracraft@rice-chex.ai.mit.edu (Stuart Cracraft)
- Posting-number: Volume 13, Issue 97
- Archive-name: gnuchess4/Part09
- Supersedes: gnuchess2: Volume 4, Issue 37-40
- Environment:
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 9 (of 12)."
- # Contents: doc/CHANGES doc/ChangeLog doc/PORTING src/gnuchess.h
- # Wrapped by billr@saab on Fri Jun 19 08:36:02 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'doc/CHANGES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/CHANGES'\"
- else
- echo shar: Extracting \"'doc/CHANGES'\" \(15786 characters\)
- sed "s/^X//" >'doc/CHANGES' <<'END_OF_FILE'
- X GNU CHESS HISTORY
- X (#include "../version.h")
- X
- XJanuary 8, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XChanged the transpositon table to allow 66536 positions per player.
- XThis means a 1.3 Mbyte hash table. Introduced simple rehashing. And
- Xalso made setting ttable 0 exclude all transposition code from
- Xgnuchess (for machines with very little memory).
- X
- X
- XJanuary 3, 1990 -- Tom Vijlbrief (tnosoes!tom@nluug.n)
- XContributed code to fix undo of promotions.
- XAnd a bugfix RMBLY was to small.
- X
- X
- XJanuary 27, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XFixed nuxdsp.c to work with my changes (Saved games format)
- X
- X
- XJanuary 26, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XVerified that the underpromotion routines works.
- XFound and fixed the bug that caused gnuchess to report mate
- Xand draw prematurely.
- X
- X
- XJanuary 25, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XReceived the underpromotion additions from jhol@tolsun.oulu.fi
- XMade some optimizations in trapped and KingScan.
- XAdded more comments on how to improve the search.
- XAdded info on usage of the array Tree in post mode.
- XChanged the index in the transposition table to unsigned short to
- Xallow a hash table of size 65536.
- X
- X
- XJanuary 11, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XFormatted gnuchess according to GNU standards with indent.
- X
- X
- XJanuary 9, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- XInserted a missing comma in KTHRT.
- XRemoved mvstr1[5],mvstr2[5] from gnuchess.c, they are only used in the
- Xuser-interface routines uxdsp.c nondsp.c anyway.
- XRewrote algbr to generate move strings for underpromotion. (ph8k or h7h8k)
- XSome optimizations in CaptureList.
- XChanged row, column and locn to macros.
- XMade memset default and introduced a switch NOMEMSET for computers without
- Xmemset or where memset is a speed penality. I tested this on:
- XSparc - no change, DECstation - no change and Sun3/60 - 4% speed improvment.
- XChanged + to | in some bit-field manipulations.
- XFixed the castle-with-moved-rook-bug, removed kingmoved and introduced
- Xan array Mvboard to keep track on how many times we have moved from a
- Xparticular square.
- XFixed the check for zero division in Time controls.
- XAdded BINDIR and LIBDIR in the Makefile to set where gnuchess and
- Xgnuchess.book gets installed.
- XAll I have to do now is to test if all this works (-:
- X
- XFebruary 3, 1990 -- Tom Vijlbrief
- XNoticed an error in the rook mobility bonus. RMBLTY array was
- Xindexed 0 to 14, but had only 14 members. Added final member.
- X
- XJanuary 1, 1990 -- Stuart Cracraft (cracraft @wheaties.ai.mit.edu)
- XSome special openings were inserted and some taken out.
- XA small change was made to allow the program to detect draws earlier
- Xin the tree (via Stanback).
- XThinking on opponent's time is now working in nondsp.c. For some
- Xreason it had been deactivated.
- XTested GNU Chess 1.55 with with Chesstool on a SUN.
- XMatch vs. Fidelity Mach 3 (USCF 2265) resulted in 7-3 score for GNU
- Xon a Sparcstation giving a 2325-2335 performance result.
- X
- XJanuary 1, 1990 -- Hes @log-se.sv
- XHe contributed faster move generator routines.
- X
- XAugust 1, 1989 -- Jay Scott
- XHe proofread the opening book and made
- Xcorrections.
- X
- XJune 9, 1989 -- Tim Radzy (unet!nplab4!radz@ames.arc.nasa.gov)
- XHe fixed a bug in xchess/board.c. In a post-game new-game situation,
- Xcastling wouldn't be permitted under circumstances. Tim made
- Xit possible to castle again.
- X
- XMay 12, 1989 -- Joe Garbarini (garbarini%kegger@circus.llnl.gov)
- XRecommended changes to documentation vis a vis chesstool usage.
- X
- XMay 5, 1989 -- Jouko Holopainen (jhol@tolsun.oulu.fi)
- XWrote code to support underpromotion.
- XChanged interface to accept ECO/Informator style moves.
- X
- XApril 30, 1989 -- Various GNU contributors
- Xsetlinebuf() modification for xchess/chesstool.
- Xcheck for zero division in time printout.
- X
- XJanuary 17, 1989 -- Anders Thulin
- XProvided extensive addition to the opening book for his
- Xfavorite opening the Vienna Game. This was drawn from ECO.
- X
- XNovember 23, 1988 -- Stuart Cracraft
- XInstalled new version of Xchess that is better debugged, works on
- Xthe next version of X. Thanks to Wayne Christopher and Arturo Perez.
- X
- XAugust 28, 1988 -- Stuart Cracraft
- XRemoved a sacrifice line from the Giuoco Piano entry in the opening
- Xbook; the program didn't seem to like the positions it got from this line.
- X
- XDecember 30, 1987 -- John Stanback
- XWrote a short blurb on the heuristics contained in GNU Chess. It resides
- Xin the subdirectory DOCUMENTATION as the file HEURISTICS.
- X
- XDecember 17, 1987 -- John Stanback
- XModified criteria for positional evaluation in quiescence search
- Xto include positions in which the estimated score lies within
- Xthe alpha-beta window; fixed a bug in the king proximity to pawns heuristic;
- Xfixed a bug involving passed pawn heuristics;
- X
- XDecember 16, 1987 -- Stuart Cracraft
- XAdded automatic 'list' upon exit (both in display, non-display, and
- Xchesstool mode); command-line setting of tournament time controls
- Xbug fixed.
- X
- XDecember 14, 1987 -- John Stanback
- XGNU defeated the commercial product 'Fidelity Excellence' 5.5-4.5 in
- Xa 10-game match. It was running at about 500 nodes per second (typical
- Xof its speed on a VAX 8650) and this would indicate its strength
- Xwould be about USCF 1875-1900.
- X
- XDecember 4, 1987 -- John Stanback
- XMan page added. Command line arguments now specify regular clock
- Xsettings if so desired (useful for SUN players). Thinking
- Xon opponent's time is now disabled by default. Estimated
- Xrating is 1850 at 500 nodes per second.
- X
- XOctober 20, 1987 -- Stuart Cracraft
- XFixed GNU/SUN interaction. Chesstool and its features now
- Xseem to fully work.
- X
- XOctober 5, 1987 -- Ken Thompson
- XGNU beat Belle (actually drew due to a bug, but
- XKen kept GNU playing through to the win) while
- Xrunning on a Cray XMP-48. In this 3-1 time handicap game
- XBelle outsearched Cray GNU by 10-1 (even with the handicap).
- X
- XSeptember 26, 1987 -- John Stanback at HP
- XHash table functioning. Thinking on opponent's
- Xtime functioning.
- X
- XAugust 20, 1987 -- Mike Meyer at Berkeley
- XMike ran GNU Chess on a Cray 1 supercomputer.
- XThe system was very heavily loaded, so the
- Xprogram was not as speedy as with the Cray below.
- X
- XAugust 16, 1987 -- David Goldberg at SUN
- XHe added "chesstool" support so that this
- Xversion of GNU Chess can run under the
- Xdisplay manager "chesstool".
- X
- XAugust 15, 1987 -- John Stanback at HP
- XHash tables, more heuristics, a modified
- Xsearch which is more efficient. He also
- Xdiscovered a bug in the piece-exchanger. This
- Xwould cause the program to exchange pieces suboptimally.
- XWith this fix, the program should play much
- Xmore strongly.
- X
- XAugust 13, 1987 -- Ken Thompson at Bell Labs
- XKen ran GNU Chess on a Cray XMP supercomputer
- X (among other processors). The program got
- X about 3000-4000 chess positions per second
- X which is comprable to today's fastest bit-slice
- X commercial machines. Also, he had GNU Chess
- X play two games against Belle.
- X
- XJuly 19, 1987 -- Jay Scott & John Stanback
- X Many positional heuristics have been added.
- X
- XJuly 18, 1987 -- Stuart Cracraft
- X Improvements have been made to the opening
- X book. It is mostly an MCO book, containing
- X major variations from many of the major openings
- X and particularly in-depth on Sicilian.
- X
- XMay 11, 1987 -- John Stanback at HP
- X He donated his chess program, a fairly mature
- X and strong program.
- X
- XMay 1, 1987 -- Stuart Cracraft
- X He added several bug fixes various people
- X had reported. He also changed makemove() so that
- X the calling syntax is makemove(movelist,index,board)
- X rather than makemove(move,board). Having the latter
- X tickled a bug in at least one manufacturer's C-compiler,
- X so rather than write fancy code, we simplified it.
- X
- XApril 25, 1987-- Jim Aspnes at MIT
- XHe added all sorts of useful capabilities,
- Xincluding positional evaluation in the tree
- Xsearch using a table-driven algorithm,
- Xmodifying transposition table code in order
- Xto work properly, though it doesn't improve
- Xspeed too much, checkmates/stalemates detected
- Xin the search, en passant captures allowed,
- Xdetect repeated positions, iterative deepening,
- Xquicker quiescence search, tournament time controls,
- Xsqattacked sped up by a factor of 4, compile-time
- Xdebugging options.
- X
- XJanuary 2, 1987 -- Stuart Cracraft
- X He added a few more Tal games to the collection.
- X
- XJanuary 2, 1987 -- Jim Aspnes at MIT
- X He contributed MCO variations for the Catalan,
- X Queen's Indian, and Reti openings.
- X
- XDecember 29, 1986 -- Jim Aspnes at MIT
- X He contributed all MCO variations of the Najdorf
- X to the opening book. He also contributed a LISP
- X macro (written in GNU Emacs Lisp) to convert
- X xchess game formats to GNU Chess opening book
- X format.
- X
- XDecember 14, 1986 -- Ken Thompson at Bell Labs
- X He contributed almost 200 games by Tal to
- X our collection of Tal-games, bringing the
- X total number of Tal positions in the book
- X to 10,692. Total book positions now 13,207.
- X These reside in bookin, bookin.bdg, bookin.tal.
- X Note that presently, only bookin and bookin.tal
- X can be used. The new Tal positions came in a
- X slightly different format, which we have chosen
- X to adopt as our standard format. All book
- X games in bookin and bookin.bdg will gradually
- X change into the new standard format.
- X
- XDecember 11, 1986 -- Stuart Cracraft
- X Added "averages" for node-count per move,
- X cpu per move, rate per move to list_history
- X and write_history.
- X New version of Xchess installed.
- X Started typing in Tal games into "bookin.tal".
- X Added "total book positions" printout to "book"
- X and "enter" statistics printout.
- X
- XDecember 10, 1986 -- Stuart Cracraft
- X Implemented aspiration search in normal
- X alpha-beta search. Speedups of 3% to 40%
- X have been noticed in most positions.
- X Occasionally a slower search will result,
- X but it is thought these are worth the
- X usual speedups.
- X
- XDecember 9, 1986 -- Stuart Cracraft
- X Fixed minor bug in write_history()
- X Added another Tal game, 2nd game of 1st world
- X championship match with Botvinnik, a Benoni.
- X
- XDecember 9, 1986 -- Stuart Cracraft
- X Enhanced parallelism. All parallel processors
- X now communicate via a shared data file and
- X are kept running (in idle loops watching the
- X shared data file). This saves us a few seconds
- X on each move since the 'rsh' need not be invoked
- X more than once (at the beginning). Since the
- X shared data file is now implemented, we will
- X next work towards a "parallel anarchy" in which
- X any processor can use any other processor in
- X order to reduce its search. The current scheme
- X with the program being only as fast as its slowest
- X processor, is quite inefficient.
- X
- XDecember 1, 1986 -- Jim Aspnes at MIT
- X Added a couple of Master games from
- X Modern Chess Openings 12 (a Fischer game,
- X and a Matanovic game).
- X
- XNovember 30, 1986 -- Stuart Cracraft
- X Added parallelism. Can now handle multiple
- X processors (sharing same disk). Later we will
- X add the capability to use processors not sharing
- X the same disk. Modified README and MAN-PAGE.
- X
- XNovember 26, 1986 -- Stuart Cracraft
- X Fixed a few bugs in book-mailing mechanism.
- X Fixed a bug regarding situations where only
- X one move is available.
- X Fixed a bug in read_history() that caused
- X Black queenside castles to be mishandled.
- X
- XNovember 25, 1986 -- Stuart Cracraft
- X Added two pawn heuristics. Reward pawns moving into
- X a phalanx of pawns. A phalanx is two or more
- X horizontally-connected pawns. Likewise, penalize
- X pawns leaving a phalanx of pawns. The penalty for
- X leaving is a little more than the reward for
- X entering.
- X
- XNovember 24, 1986 -- Stuart Cracraft
- X A user reported an unbelievable bug. Investigation
- X of this bug led to the discovery that GNU Chess was
- X not picking the move judged best by the tree search
- X in all cases. This resulted in the bug showing
- X itself which further showed that the program was
- X selecting an inferior move. This may result in an
- X improvement to the program's play.
- X
- XNovember 24, 1986 -- Stuart Cracraft
- X Added two heuristics. Penalize king moves if
- X the king hasn't castled yet. Also, penalize pawn
- X moves which produce doubled pawns. Should
- X probably have something for isolated pawns
- X too.
- X
- XNovember 23, 1986 -- Wayne Christopher at Berkeley
- X New version of X chess display front-end.
- X Fixed bugs include multiple pieces, runs
- X on SUNS & Bobcats, loads saved games.
- X
- XNovember 23, 1986 -- Stuart Cracraft
- X Cleaned up some minor bugs regarding history.
- X Added "Illegal command" error message at Wayne's
- X request.
- X
- XNovember 22, 1986 -- David Goldberg at SUN Microsystems
- X He complained that GNU Chess was memory-hungry.
- X A few minor modifications to hash.c reduced
- X uninitialized data space 87% and text space
- X 12%. This should make it easier for GNU Chess
- X to run on small computers.
- X
- XNovember 22, 1986 -- Stuart Cracraft
- X "read" command was working, but needed
- X additional tweaking so that history
- X array would be printed by list_history().
- X
- XNovember 19, 1986 -- Stuart Cracraft
- X Added "read" command which reads a history
- X file (game listing) and restores the board
- X to as if the person was still playing that.
- X particular game. Generally cleaned up
- X history mechanism, made it more orthogonal.
- X Revised README. Added doc to MAN-PAGE.
- X
- XNovember 16, 1986 -- Stuart Cracraft
- X More opening book bugs found and fixed.
- X Added capability to accept abbreviated-algebraic notation
- X for entering "book" games from files.
- X Added approximately 2500 new positions to
- X opening book from games involving the
- X opening called Blackmar-Diemer Gambit,
- X a hoary line developed by Diemer in
- X Germany years ago.
- X
- XNovember 15, 1986 -- Wayne Christopher at Berkeley
- X He modified the move generator, resulting in
- X a 28% speedup.
- X
- XNovember 14, 1986 -- Stuart Cracraft
- X He documented a lot of the GNU Chess modules
- X with brief comments for each function. More
- X extensive internal documentation may go in
- X later.
- X
- XNovember 14, 1986 -- Wayne Christopher at Berkeley
- X He created the Xchess interface for
- X GNU Chess to have windowing with X windows.
- X
- XNovember 14, 1986 -- Stuart Cracraft
- X He added a "randomization" feature to
- X the opening book. This will cause the
- X program to select randomly from alternate
- X variations whenever -DBEST is removed
- X from Makefile's CFLAGS. If this is not
- X removed, the opening play selects the
- X first move found in the book as it appears
- X "in order" in the human-readable book.
- X
- XNovember 14, 1986 -- David Goldberg at SUN Microsystems
- X He responded to a query about dbm(3) which
- X eventually resulted in the fixing of a subtle
- X bug in the book code which was causing the
- X program to sometimes hash to the incorrect
- X address and thereby produce a book move which
- X didn't even exist in the book. Thanks David!
- X
- XNovember 14, 1986 -- Stuart Cracraft
- X He added the "oboard" routine in util.c. This
- X is the reverse of the already extant "iboard"
- X (same module). These two routines translate
- X between GNU Chess internal format and
- X Forsythe notation.
- X
- XNovember 10, 1986 -- Stuart Cracraft
- X He added the "enter" command. This causes
- X the current game to be entered in the book.
- X Then, GNU Chess tries to mail this new entry
- X to the book maintainers (for inclusion in
- X the master copy of the book).
- X
- XNovember 9, 1986 -- Stuart Cracraft
- XHe added code for an opening book. MAN-PAGE
- Xand README were modified accordingly.
- X
- XNovember 8, 1986 -- Stuart Cracraft
- XChecks and mates are now noticed at ply-1.
- XThis is a more complete fix to the Oct 31 fix.
- X
- XOctober 31, 1986 -- Stuart Cracraft
- XFirst attempt at fix to bug which causes
- Xprogram to check human's king when program
- Xitself is in check.
- X
- XOctober 31, 1986 -- Mly at MIT
- XReported a bug which caused program to crash
- Xwhen an illegal human move was played. Fixed.
- XAlso, program was unable to play as White. Fixed.
- X
- XOctober 22, 1986 -- Stuart Cracraft
- XPps now rewards moves which liberate bishops.
- X
- XOctober 19, 1986 -- Stuart Cracraft
- XAdded bitmapper routines to distribution.
- XAdded version notice.
- X
- XOctober 19, 1986 -- David Goldberg at SUN Microsystems
- XInterfaced GNU Chess with SUN's chesstool.
- X
- XOctober 18, 1986 -- Initial release date.
- X
- X
- END_OF_FILE
- if test 15786 -ne `wc -c <'doc/CHANGES'`; then
- echo shar: \"'doc/CHANGES'\" unpacked with wrong size!
- fi
- # end of 'doc/CHANGES'
- fi
- if test -f 'doc/ChangeLog' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ChangeLog'\"
- else
- echo shar: Extracting \"'doc/ChangeLog'\" \(17304 characters\)
- sed "s/^X//" >'doc/ChangeLog' <<'END_OF_FILE'
- XSun May 31 Patchlevel 44 Bart Massey (bart@cs.uoregon.edu
- X * Rename structure element move to bmove in book.c since
- X curses.h defines a move macro.
- X * Get rid of superfluous returns in dspcom.c and checkbook.c
- X * Be sure beep message has an arg in uxdsp.c
- X * Add exit status to exit() call in checkbook.c
- XSat May 30 Patchlevel 43 Stuart Cracraft (cracraft@rice-chex.ai.mit.edu)
- X * Fix checkmate/draw handling.
- X * Add current module copyrights and COPYING.
- X * Ifdef forced-mate announcements as too buggy.
- XFri May 29 Patchlevel 42 Stuart Cracraft (cracraft@rice-chex.ai.mit.edu)
- X * HUNGP/HUNGX in eval.c updated to values used by Slate/Atkin
- X of Chess 4.x. This fixes a problem with Reinfeld's #281
- X and poor play in Alapin's opening. General play against
- X me has been much better.
- XMon May 11 Patchlevel 41 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * genmove update to look at less possible promotion moves
- X * fix bugs in move ordering logic
- X * remove operator time as a default
- XThur Apr 30 Patchlevel 40 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * Book updates from Timm Mann(mann@src.dec.com)
- X * Search updates to look more at possible promotion moves
- X * Transposition table update from U. Koistinen (md85-epi@nada.kth.se)
- X to allow for estimated scores.
- XMon Apr 27 Patchlevel 38 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * book updates for Cochrane from Timm Mann(mann@src.dec.com)
- X * added limit for infinite checks in endgame to tree search
- X to limit time spent in any branch
- XWed Apr 25 Patchlevel 38 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix slowdown caused by previous changes.
- XWed Apr 22 Patchlevel 37 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix sizes of ttable (malloc) and hashfile (-c option)
- X to allow for rehashing
- X * eliminate pick replace with qsort
- X * adjust lookahead limits
- XThur Apr 15 Patchlevel 35 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix bugs in search logic
- XMon Apr 13 Patchlevel 34 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * Fix bugs in game win/draw logic.
- XFri Apr 8 Patchlevel 34 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * rewrite time control moving it up a level
- X * replace sorts with qsort
- X * fix material command to all multiple N's and B's
- X * and make it an ifdef on NOMATERIAL
- XFri Mar 30 Patchlevel 32 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * make MINDEPTH a define
- X * eliminate #ifdef's for hashbd/hashkey it is always required
- X * up MINDEPTH to 2 to always get a hint
- X * add some dynamics to eval/estimate decision
- X * more dynamic time allocation
- XFri Mar 27 Patchlevel 30 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix hashfile code again
- X * fix startup for no book present
- X * fix race condition in search
- X * allow parameters on commands
- XWed Mar 25 Patchlevel 28 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix bug in hashfile debug code
- X * add material check for draw and material command
- X * fix QUIETBACKGROUND code
- XTue Mar 24 Patchlevel 27 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix book move reject to not select a ? move
- X * add check to HASHFILE option to check for ilegal move
- X * document debug options
- XMon Mar 23 Patchlevel 26 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * Add multiple time controls
- X * apply fixes from R.K.Lloyd@compsci.liverpool.ac.uk
- X for screen update problems in visual mode
- XSun Mar 22 Patchlevel 25 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * Update man pages
- X * fix false mate problem with transposition table
- X * add history killers option but don't use it.
- X * fix handling of input parameters so the doc and the
- X program agree
- X * allow time to be specified in seconds (machines are faster now)
- X * add QUIETBACKGROUND option from md85-epi@nada.kth.se.
- X * put in book patch from md85-epi@nada.kth.se.
- X
- XSun Mar 15 Patchlevel 22 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * Add options for SpaceBonus table levels
- X * Switch to new book
- X * Add polling code for keyboard
- X
- XTue Mar 10 Patchlevel 21 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * correct depth test in PutInTTtable
- X * patch from Urban Koistinen (md85-epi@nada.kth.se)
- X correcting bug in repetition
- X
- XMon Mar 9 Patchlevel 20
- X * correct defaults for MEMSET
- X
- XSat Mar 7 Patchlevel 19 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * add speedups by using memset for ZeroRPT
- X * rewrite ScoreSpace
- X * rewrite pick
- X
- XThur Mar 5 Patchlevel 18 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix bug in timing that led to negative times
- X * change time allocation to be more flexible
- X * based on score and depth
- X * eliminate a bad opening from the book
- X
- XSat Feb 15 Patchlevel 17 Urban Koistinen (md85-epi@nada.kth.se)
- X * Added option -T n to set transposition table size 2^n.
- X * -r n set rehash to n.
- X * Changed repetition to make it work harder.
- X * ScoreSpace changed to value central squares higher.
- X * Made go change colors so white&black work as they should.
- X
- XFri Dec 30 08:34:00 1991 Patchlevel 16
- X * Fix to eval.c for mis-transcribed sign in ScoreKBNK.
- X * Fix to malloc call in init.c.
- X * ScorePosition updated with addition of ScoreSpace
- X to add in points for threats in a position.
- X from Urban Koistinen (md85-epi@nada.kth.se)
- X * Various tuning of parameters
- X
- XFri Nov 30 08:34:00 1991 Patchlevel 15
- X * from nv-90-mho@nada.kth.se
- X patch to make listfile name meaningful instead of a random number
- X * from Urban Koistinen (md85-epi@nada.kth.se) move generation
- X speedup for non-pawn moves and move selection improvements.
- X * from Mike McGann (mwm@hslrswi.hasler.ascom.ch) added language
- X file to allow multiple languages to be supported. Fix broken
- X search on opponents time, fix bad moves in book.
- X
- XMon Oct 19 08:34:00 1991 Urban Koistinen (md85-epi@nada.kth.se)
- X * patchlevel 14
- X
- X * fix checks in castling logic to only allow kings to do it.
- X
- X * fix repetition logic "all pieces are the same" bug.
- X
- XThur Oct 10 13:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * patchlevel 14
- X
- X * expand the timing logic to allow more time in unstable
- X positions
- X
- X * Update man pages
- X
- X * Fix printout bug in Checkbook
- X
- XTue Oct 8 13:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * patchlevel 13
- X
- X * General cleanup, Fix screens, prompts, rate calculation
- X
- XSun Oct 5 13:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * patchlevel 12
- X * Change eval.c/KingValue to ignore Mking if the otherside
- X has only pawns on the board. Tuning parameter is
- X KINGPOSLIMIT.
- X
- X * Fix time print in gnuchess and gnuchessx.
- X
- X * Use ShowMessage for all error messages.
- X
- X * Fix post option to print time in seconds.
- X
- XSun Oct 5 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * patchlevel 11
- X * speedups in search. Eliminate unused computation.
- X
- X * change eval.c/KingValue to ignore Mking if there are
- X only pawns on the board. Tuning Parameter is KINGPOSLIMIT.
- X
- X * make DITHER a tuning parameter.
- X
- XTue Oct 1 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * patchlevel 10
- X * fix eval bug in ScorePosition. Evaluated pawn structute
- X incorrectly. Introduced when gnuchess was split up.
- X
- X * Change default for SCORETIME to -9000 it plays better
- X
- X * correct promotion logic for CHESSTOOL and XBOARD only queens
- X are generated now.
- X
- X * correct handling of TOflag for bothsides mode.
- X
- XMon Sept 27 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X * fix more enpassant bugs in checkgame/checkbook
- X
- X * misc speedups by inlining code.
- X move SqAtakd to ataks.h and inline it.
- X
- X * Modify checkbook to also read xboard game files and
- X check them for illegal moves.
- X
- X * fix bug in game.c introduced by patch 8
- X
- XMon Sept 26 08:34:00 1991 Urban Koistinen (md85-epi@nada.kth.se)
- X
- X * Correct the making and unmaking of enpassant moves and
- X numerous incorrect usages of ? throughout the program.
- X
- XMon Sept 24 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X
- X * force search re-init if PV chavges due to a timeout
- X
- X * add patchlevel to the -v option to keep version straight.
- X
- X * Change search and timing logic. Search now backs up to
- X previous level on a timeout. Search adds time to the search
- X if the last top level PV is different from the current and
- X this level is not finished. Seems to play much stronger.
- X
- XMon Sept 16 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X
- X * Opening book now handles transitions. It continues looking
- X at the book until 2 (tunable) successive turns fail to find a move
- X there.
- X
- X * GetOpenings now checks for errors on input. The current book was full
- X of illegal moves. They were filtered out since at game time the book
- X move is matched against the legal move list. But it makes for bad
- X opening play. EnPassant moves are not allowed in openings(a limitation?)
- X Checks made are the there is a piece on the from square belonging
- X to the right side and there is no piece or a piece belonging to the
- X other side on the to square. There is no check that the piece is
- X moving legally.
- X
- X * ListGame now makes up the name chess.lst.random#. So if you are
- X using xboard to play a match (two machine mode) they won't overwrite.
- X
- X * Added patch from Randy Ray (rray@SPECLAB.CR.USGS.GOV) to correctly
- X format chess.lst
- X
- XWed Sept 4 08:34:00 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X
- X * Renamed gnuchess3.1+ to gnuchess to reflect the split in
- X gnuchess development. There now seems to be 3 threads.
- X Gnuchess, gnuchess for windows (3.21), and the gnuchess4
- X project if it still exists.
- X * Fix chesstool version to handle white as well as black.
- X * Split program into modules for easier maintinance and
- X development.
- X * Fixed Illegal move bug in VerifyMove for promotion moves.
- X * Replaced ResponseTime calculations with simpler version that
- X stays within the time limits and seems to do as well or better
- X in play.
- X * General cleanup of the search algorithm
- X * Fixed gnuan input processing and termination code.
- X * Fixes to work with xboard match mode
- X * Added TEST directory with 16 problems from Levy's
- X Computer Chess book.
- X
- XTue Aug 6 18:10:47 1991 Philippe Schnoebelen (phs@lifia.imag.fr)
- X
- X * Modify handling of Book in Undo (previously, when you
- X backtracked after quitting the book, the program was not able to
- X use it again)
- X
- X * Modify handling of Book in EditBoard and other routines so that
- X the Book is not used if you don't start from the regular initial board.
- X
- XMon Aug 5 17:26:59 1991 Philippe Schnoebelen (phs@lifia.imag.fr)
- X
- X * Modify parse in gnuchess.c so that a move can be followed by '?'
- X indicating that the program should not play it itself. Such a move
- X is stored with the highest bit raised.
- X Modify OpeningBook in gnuchess.c so that moves with highest bit
- X set are recognized but not played by the program.
- X
- X * Modify the declaration of array PieceList in gnuchess.[ch] to
- X allow for up to 64 men of the same side. Such artificial
- X situations can be built with edit and the program must be able to
- X deal with them.
- X
- XMon Aug 1 10:20 1991 Mike McGann (mwm@hslrswi.hasler.ascom.ch)
- X Split chesstool and xboard versions. Xboard is now
- X gnuchessx and chesstool is gnuchessc.
- X
- XMon Apr 15 10:20 1991 Mike McGann {mwm@hslrswi.hasler.ascom.ch)
- X Changed transposition table to cache positions found in transposition file
- X Fix Undo's incorrect handling of promotions.
- X Fix win and draw determination bugs.
- X Fix bug in algbr that prevented correct display of promotion moves.
- X Fix Undo to correctly display side to move.
- X Add path to command line for save file and load file.
- X Make save file human readable
- X
- XThu May 24 13:42:24 1990 Hans Eric Sandstr|m (hes at baloo)
- X * Fixed a bug reported by Brian Wong (wong@cs.UAlberta.CA) in
- X ScoreKPK
- X
- XSat May 5 15:58:31 1990 Hans Eric Sandstr|m (hes at baloo)
- X * extensive tests on MSDOS for 2 weeks and lots of changes:
- X Moved all flags to a special flag structure.
- X Added my own TODO file to the DOCUMENTATION.
- X Moved GetOpenings and parse from the *dsp.c files.
- X Made the transposition table enabled by default.
- X Some cleanup in the *dsp.c code.
- X Changed UpdateHashbd to a macro.
- X
- XWed Apr 18 16:38:30 1990 Hans-Erik Sandstr|m (hes at tiamat)
- X * Removed unnessesary global variables:
- X (wking, bking, Enemyking, INCscore, slk, InChk, HasPawn,
- X Zwmtl, Zbmtl, lpost, KBNKsq) this should make the program more
- X readable.
- X * Added a mini transposition table to detect repetitions, this
- X means that repetition is called more seldom and should save some
- X time. The idea for this came from Benno Tietz
- X (tietz@eos.informatik.uni-bonn.de)
- X
- XThu Mar 29 02:49:00 1990 Thorsten Ohl at (td12@ddagsi3.bitnet)
- X * nuxdsp.c has been given an ANSI interface (tailored
- X after uxdsp.c as of Version 3.00 and a homegrown
- X ANSI interface created in January for Version 1.55).
- X * uxdsp.c now understands ^C interrupts.
- X * both nuxdsp.c and uxdsp.c support the graphic characters
- X of the IBM PC (can be disabled with -DSEVENBIT).
- X It's of course a matter of taste, but I think it looks
- X much better.
- X * I have added prototypes and a makefile for a **IX compatible
- X MS-DOS make (neither Turbo C or Microsoft C will understand
- X this!).
- X * some formal parameters are not referenced. This is due to the
- X different display interfaces and no problem at all. Just for
- X aesthetic reasons I have shut up the compiler by incrementing
- X the unreferenced variables.
- X * some longs are assigned to shorts and some shorts to unsigned chars.
- X I have introduced a cast in each case, all are o.k. (as far
- X as I can tell).
- X
- XThu Mar 8 09:11:28 1990 Hans-Erik Sandstr|m (hes at orsa1)
- X * The persistent hash table seems to work now. There are still some
- X problems using it on a heterogenous network.
- X
- XSun Mar 4 14:44:44 1990 Hans Eric Sandstr|m (hes at orsa)
- X * I am working on a persistent hash table. Currenly a 10Mb file
- X with 262144 entrys. Stuart just asked me to spilt the posdata
- X array to make gnuchess work better on a PC, so I did that.
- X I have also tried to properly fix the bug that caused gnuchess
- X to report mate prematurely. This, I hope, will also improve the
- X search.
- X
- XTue Feb 27 18:27:23 1990 Hans Eric Sandstr|m (hes at davidson.log-sv.se)
- X * used protoize to make a function prototyped version of gnuchess.
- X this means that I have to use unprotoize before 'make distribution'
- X to make a more portable K&R version.
- X removed a ZeroTTable so now the hashtable is kept between moves.
- X
- XSat Feb 24 13:14:14 1990 Hans Eric Sandstr|m (hes at orsa)
- X * Added a test to detect hash table collisions, define HASHTEST.
- X I also removed the times calls since there is no sense in
- X measuring cpu time when wallclock time is all that counts when
- X playing chess.
- X
- XFri Feb 23 17:25:37 1990 Hans Eric Sandstr|m (hes at orsa)
- X * Compiled gnuchess with gcc1.37 -Wall and got lots of
- X implicit decaration warnings. Solved most of these by adding
- X external declarations in gnuchess.h.
- X
- XWed Feb 21 17:41:28 1990 Jouko Holopainen (jhol@tolsun.oulu.fi)
- X * Contributed his code for ECO move entry (again!)
- X and a file ansidsp.c (A msdos port of uxdsp.c).
- X I(hes) started a merge of ansidsp.c and uxdsp.c.
- X
- XFebruary 8, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Changed the transpositon table to allow 65536 positions per player.
- X This means a 1.3 Mbyte hash table. Introduced simple rehashing. And
- X also made setting ttable 0 exclude all transposition code from
- X gnuchess (for machines with very little memory).
- X
- X
- XFebruary 3, 1990 -- Tom Vijlbrief (tnosoes!tom@nluug.n)
- X Contributed code to fix undo of promotions.
- X And a bugfix RMBLTY was to small.
- X
- X
- XJanuari 27, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Fixed nuxdsp.c to work with my changes (Saved games format)
- X
- X
- XJanuari 26, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Verified that the underpromotion routines works.
- X Found and fixed the bug that caused gnuchess to report mate
- X and draw prematurely.
- X
- X
- XJanuari 25, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Received the underpromotion additions from jhol@tolsun.oulu.fi
- X Made some optimizations in trapped and KingScan.
- X Added more comments on how to improve the search.
- X Added info on usage of the array Tree in post mode.
- X Changed the index in the transposition table to unsigned short to
- X allow a hash table of size 65536.
- X
- X
- XJanuari 11, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Formatted gnuchess according to GNU standards with indent.
- X
- X
- XJanuari 9, 1990 -- Hans Eric Sandstrom (hes@log-sv.se)
- X Inserted a missing comma in KTHRT.
- X Removed mvstr1[5],mvstr2[5] from gnuchess.c, they are only used in the
- X user-interface routines uxdsp.c nondsp.c anyway.
- X Rewrote algbr to generate move strings for underpromotion.
- X (ph8k or h7h8k)
- X Some optimizations in CaptureList.
- X Changed row, column and locn to macros.
- X Made memset default and introduced a switch NOMEMSET for
- X computers without memset or where memset is a speed penality.
- X I tested this on:
- X Sparc - no change
- X DECstation - no change
- X Sun3/60 - 4% speed improvment.
- X Changed + to | in some bit-field manipulations.
- X Fixed the castle-with-moved-rook-bug, removed kingmoved and introduced
- X an array Mvboard to keep track on how many times we have moved from a
- X particular square.
- X Fixed the check for zero division in Time controls.
- X Added BINDIR and LIBDIR in the Makefile to set where gnuchess and
- X gnuchess.book gets installed.
- X All I have to do now is to test if all this works (-:
- END_OF_FILE
- if test 17304 -ne `wc -c <'doc/ChangeLog'`; then
- echo shar: \"'doc/ChangeLog'\" unpacked with wrong size!
- fi
- # end of 'doc/ChangeLog'
- fi
- if test -f 'doc/PORTING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/PORTING'\"
- else
- echo shar: Extracting \"'doc/PORTING'\" \(1738 characters\)
- sed "s/^X//" >'doc/PORTING' <<'END_OF_FILE'
- XThis is a note how to port gnuchess to machines with scarce memory:
- Xgnuchess minimal requirements are:
- X - approximately 100 kByte memory for the executable program.
- X - at least 200 kByte for data structures.
- XYou dont want to port gnuchess to a machine with less memory than that.
- X
- Xgnuchess is optmized for speed and that means that memory has been used
- Xwhen there has been a tradeoff between memory usage and speed. If you intend
- Xto run gnuchess on a machine with less than 2 Mbyte memory the size of some
- Xdata structures have to be reduced. Here is a list of the largest data
- Xstructures in gnuchess, their sizes and a small comment on what can
- Xbe done to reduce their size:
- X
- Xttable: 1.3 MByte (#define ttblsz <something small>)
- Xnextpos: 32 kByte (nothing save rewiting all move generation)
- Xnextdir: 32 kByte (nothing save rewiting all move generation)
- XTree: 20 kByte (change f,t to unsigned char)
- Xhistory: 8 kByte (can be removed)
- Xdistdata: 8 kByte (can be changed to a macro)
- Xtaxidata: 8 kByte (can be changed to a macro)
- Xhashcode: 7 kByte (#define ttblsz 0)
- X
- XFirst of all, start by reducing the transposition table size, this
- Xis done by setting ttblsz in (gnuchess.c). If the transopsition table
- Xdoes not fit entiely in memory it will have a detrimental effect on
- Xperformance. You can remove the transposition table by setting ttblsz 0.
- XIf this isn`nt enough, reconsider if you really want to do this port.
- XThere is`nt really that much to gain by changing the other
- Xdata structures.
- X
- XHere are the macros:
- X#define taxicab(a,b) (abs(column (a) - column (b)) + abs (row (a) - row (b)))
- X#define distance(a,b) \
- X ((abs(column (a) - column (b)) > abs (row (a) - row (b)))
- X ? abs(column (a) - column (b)) : abs (row (a) - row (b)))
- X
- X
- END_OF_FILE
- if test 1738 -ne `wc -c <'doc/PORTING'`; then
- echo shar: \"'doc/PORTING'\" unpacked with wrong size!
- fi
- # end of 'doc/PORTING'
- fi
- if test -f 'src/gnuchess.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/gnuchess.h'\"
- else
- echo shar: Extracting \"'src/gnuchess.h'\" \(17641 characters\)
- sed "s/^X//" >'src/gnuchess.h' <<'END_OF_FILE'
- X/*
- X * gnuchess.h - Header file for GNU CHESS
- X *
- X * Copyright (c) 1988,1989,1990 John Stanback
- X * Copyright (c) 1992 Free Software Foundation
- X *
- X * This file is part of GNU CHESS.
- X *
- X * GNU Chess is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 2, or (at your option)
- X * any later version.
- X *
- X * GNU Chess is distributed in the hope that it will be useful,
- X * but WITHOUT ANY WARRANTY; without even the implied warranty of
- X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X * GNU General Public License for more details.
- X *
- X * You should have received a copy of the GNU General Public License
- X * along with GNU Chess; see the file COPYING. If not, write to
- X * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X */
- X
- X#include <stdio.h>
- X/* <stdio.h */
- Xextern int fclose (FILE *);
- Xextern int fscanf (FILE *, const char *,...);
- Xextern int fprintf (FILE *, const char *,...);
- Xextern int fflush (FILE *);
- X
- X#define SEEK_SET 0
- X#define SEEK_END 2
- X#ifdef DEBUG
- Xvoid
- XShowDBLine (char *, short int, short int,
- X short int, short int, short int,
- X short unsigned int *);
- X extern FILE *debugfd;
- X extern short int debuglevel;
- X
- X#endif /* DEBUG */
- X
- X#if !defined(__STDC__) || !defined(MSDOS)
- X#define const
- X#endif
- X
- X#ifndef __GNUC__
- X#define inline
- X#endif
- X
- X#include <ctype.h>
- X
- X#ifdef MSDOS
- X#include <stdlib.h>
- X#include <string.h>
- X#include <time.h>
- X#define RWA_ACC "r+b"
- X#define WA_ACC "w+b"
- X#else
- X#define RWA_ACC "r+"
- X#define WA_ACC "w+"
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <sys/times.h>
- X#endif /* MSDOS */
- X#ifdef NONDSP
- X#define printz printf
- X#define scanz scanf
- X#else
- X#include <curses.h>
- X#define scanz fflush(stdout),scanw
- X#define printz printw
- X#endif
- X
- X/* <stdlib.h> */
- X extern int abs (int);
- X extern int atoi (const char *);
- X
- X/* <time.h> */
- X extern long int time (long int *);
- X
- X/* <string.h> */
- X extern void *memset (void *, int, size_t);
- X
- X
- X/* Piece values */
- X#define valueP 100
- X#define valueN 350
- X#define valueB 355
- X#define valueR 550
- X#define valueQ 1100
- X#define valueK 1200
- X/* masks into upper 8 bits of ataks array */
- X#define ctlP 0x4000
- X#define ctlN 0x2800
- X#define ctlB 0x1800
- X#define ctlR 0x0400
- X#define ctlQ 0x0200
- X#define ctlK 0x0100
- X#define ctlBQ 0x1200
- X#define ctlBN 0x0800
- X#define ctlRQ 0x0600
- X#define ctlNN 0x2000
- X/* attack functions */
- X#define Patak(c, u) (atak[c][u] > ctlP)
- X#define Anyatak(c, u) (atak[c][u] > 0)
- X/* distance function */
- X#define taxicab(a,b) taxidata[a][b]
- X/* hashtable flags */
- X#define truescore 0x0001
- X#define lowerbound 0x0002
- X#define upperbound 0x0004
- X#define kingcastle 0x0008
- X#define queencastle 0x0010
- X/* king positions */
- X#define wking PieceList[white][0]
- X#define bking PieceList[black][0]
- X#define EnemyKing PieceList[c2][0]
- X/* constants */
- X/* castle moves */
- X#define BLACKCASTLE 0x3C3E
- X#define WHITECASTLE 0x0406
- X#define LONGBLACKCASTLE 0x3C3A
- X#define LONGWHITECASTLE 0x0402
- X/* truth values */
- X#define false 0
- X#define true 1
- X/* colors */
- X#define white 0
- X#define black 1
- X#define neutral 2
- X/* piece code defines */
- X#define no_piece 0
- X#define pawn 1
- X#define knight 2
- X#define bishop 3
- X#define rook 4
- X#define queen 5
- X#define king 6
- X#define bpawn 7
- X/* node flags */
- X#define pmask 0x0007
- X#define promote 0x0008
- X#define cstlmask 0x0010
- X#define epmask 0x0020
- X#define exact 0x0040
- X#define pwnthrt 0x0080
- X#define check 0x0100
- X#define capture 0x0200
- X#define draw 0x0400
- X/* move symbols */
- X#define pxx (CP[2])
- X#define qxx (CP[1])
- X#define rxx (CP[4])
- X#define cxx (CP[3])
- X/* for everything that can't use the above */
- X#define Qxx " pnbrqk"
- X#define Pxx " PNBRQK"
- X#define Cxx "abcdefgh"
- X#define Rxx "12345678"
- X/***************************************************************************/
- X/***************** Table limits ********************************************/
- X/*
- X * ttblsz must be a power of 2. Setting ttblsz 0 removes the transposition
- X * tables.
- X */
- X#ifdef MSDOS
- X#define vttblsz (1 << 11)
- X#else
- X#define vttblsz (1 << 17)
- X#define huge
- X#endif /* MSODS */
- X
- X#define ttblsz vttblsz
- X#define TREE 1500 /* max number of tree entries */
- X#define MAXDEPTH 35 /* max depth a search can be carried */
- X#define MINDEPTH 2 /* min search depth =1 (no hint), >1 hint */
- X#define MAXMOVES 400 /* max number of half moves in a game */
- X#define BOOKSIZE 7500 /* Number of unique position/move combinations allowed */
- X#define CPSIZE 225 /* size of lang file max */
- X/***************** tuning paramaters **********************************************/
- X#define CHKDEPTH 1 /* always look forward CHKDEPTH half-moves if in check */
- X#define DEPTHBEYOND 11 /* Max to go beyond Sdepth */
- X#define HASHDEPTH 4 /* depth above which to use HashFile */
- X#define HASHMOVELIMIT 40 /* Use HashFile only for this many moves */
- X#define PTVALUE 5361 /* material value below which pawn threats at 5 & 3 are used */
- X#define ZDEPTH 3 /* depth beyond which to check ZDELTA for extra time */
- X#define ZDELTA 10 /* score delta per ply to cause extra time to be given */
- X#define ZNODES 1000 /* check the time every ZNODES positions */
- X#define MAXTCCOUNT 4 /* max number of time clicks per search */
- X#define MINSEARCHPCT 10 /* must have looked at MINSEARCHPCT moves on a ply on a timeout */
- X#define SCORETIME -50 /* score below which to add search time */
- X#define SCORESPLIM 8 /* Score space doesn't apply after this stage */
- X#define EWNDW 10 /* Eval window to force position scoring at depth greater than Sdepth + 2 */
- X#define WAWNDW 90 /* alpha window when computer white*/
- X#define WBWNDW 90 /* beta window when computer white*/
- X#define BAWNDW 90 /* alpha window when computer black*/
- X#define BBWNDW 90 /* beta window when computer black*/
- X#define BXWNDW 90 /* window to force position scoring at lower */
- X#define WXWNDW 90 /* window to force position scoring at lower */
- X#define DITHER 1 /* max amount random can alter a pos value */
- X#define BBONUS 2 /* points per stage value of B increases */
- X#define RBONUS 6 /* points per stage value of R increases */
- X#define KINGPOSLIMIT ( -1) /* King positional scoring limit */
- X#define KINGSAFETY 16
- X#define MINTIME 200 /* MIN time to start a ply */
- X
- X#if defined AG0
- X#define WHITEAG0
- X#define BLACKAG0
- X
- X#elif defined AG1
- X#define WHITEAG1
- X#define BLACKAG1
- X
- X#elif defined AG2
- X#define WHITEAG2
- X#define BLACKAG2
- X
- X#elif defined AG3
- X#define WHITEAG3
- X#define BLACKAG3
- X
- X#elif defined AGB
- X#define WHITEAG2
- X#define BLACKAG2
- X
- X#elif defined AG4
- X#define WHITEAG4
- X#define BLACKAG4
- X#endif
- X/************************* parameters for Opening Book *********************************/
- X#define BOOKBITS 6 /* # bits for hashtable to book moves */
- X#define BOOKFAIL 2 /* if no book move found for BOOKFAIL turns stop using book */
- X#define BOOKRAND 1000 /* used to select an opening move from a list */
- X#define BOOKENDPCT 500 /* 50 % chance a BOOKEND will stop the book */
- X#define DONTUSE -32768 /* flag move as don't use */
- X/*************************** Book access defines ****************************************/
- X#define BKTBLSIZE (2<<BOOKBITS)
- X#define BOOKMASK (BKTBLSIZE - 1)
- X#define SIDEMASK 0x1
- X#define BOOKEND 0x2 /* means this is the last move of an opening */
- X#define BADMOVE 0x8000 /* means this is a bad move in this position */
- X/****************************************************************************************/
- X struct hashval
- X {
- X unsigned long key, bd;
- X };
- X struct hashentry
- X {
- X unsigned long hashbd;
- X unsigned short mv;
- X unsigned char flags, depth; /* char saves some space */
- X short score;
- X#ifdef HASHTEST
- X unsigned char bd[32];
- X#endif /* HASHTEST */
- X
- X };
- X
- X#ifdef HASHFILE
- X
- X/*
- X * persistent transposition table. The size must be a power of 2. If you
- X * change the size, be sure to run gnuchess -c before anything else.
- X */
- X#define frehash 6
- X#ifdef MSDOS
- X#define Deffilesz (1 << 11) -1
- X#else
- X#define Deffilesz (1 << 17) -1
- X#endif /* MSDOS */
- X struct fileentry
- X {
- X unsigned char bd[32];
- X unsigned char f, t, flags, depth, sh, sl;
- X };
- X
- X#endif /* HASHFILE */
- X
- X
- X struct leaf
- X {
- X short f, t, score, reply, width;
- X unsigned short flags;
- X };
- X struct GameRec
- X {
- X unsigned short gmove; /* this move */
- X short score; /* score after this move */
- X short depth; /* search depth this move */
- X short time; /* search time this move */
- X short piece; /* piece moved */
- X short color; /* color */
- X short flags; /* move flags capture, promote, castle */
- X short Game50; /* flag for repetition */
- X long nodes; /* nodes searched for this move */
- X long hashkey, hashbd; /* board key before this move */
- X#ifdef DEBUG40
- X int d1;
- X int d2;
- X int d3;
- X int d4;
- X int d5;
- X int d6;
- X#endif
- X };
- X struct TimeControlRec
- X {
- X short moves[2];
- X long clock[2];
- X };
- X
- X struct flags
- X {
- X short mate; /* the game is over */
- X short post; /* show principle variation */
- X short quit; /* quit/exit */
- X short regularstart; /* did the game start from standard
- X * initial board ? */
- X short reverse; /* reverse board display */
- X short bothsides; /* computer plays both sides */
- X short hash; /* enable/disable transposition table */
- X short force; /* enter moves */
- X short easy; /* disable thinking on opponents time */
- X short beep; /* enable/disable beep */
- X short timeout; /* time to make a move */
- X short musttimeout; /* time to make a move */
- X short rcptr; /* enable/disable recapture heuristics */
- X short rv; /* reverse video */
- X short stars; /* add stars to uxdsp screen */
- X short coords; /* add coords to visual screen */
- X short shade;
- X short material; /* draw on lack of material */
- X };
- X
- X#ifdef DEBUG
- X extern FILE *debugfile;
- X
- X#endif /* DEBUG */
- X#if !defined NOHISTORY
- X extern unsigned char history[8192];
- X#endif
- X extern char *ColorStr[2];
- X extern unsigned short int MV[MAXDEPTH];
- X extern int MSCORE;
- X extern int mycnt1, mycnt2;
- X extern short int ahead;
- X extern short int chesstool;
- X extern struct leaf Tree[], *root, rootnode;
- X extern char savefile[], listfile[];
- X extern short TrPnt[];
- X extern short board[], color[];
- X extern short PieceList[2][64], PawnCnt[2][8];
- X extern short castld[], Mvboard[];
- X extern short svalue[];
- X extern struct flags flag;
- X extern short opponent, computer, INCscore;
- X extern short WAwindow, BAwindow, WBwindow, BBwindow;
- X extern short dither, player;
- X extern short xwndw, epsquare, contempt;
- X extern long ResponseTime, ExtraTime, Level, et, et0, time0, ft;
- X extern long reminus, replus;
- X extern long NodeCnt, ETnodes, EvalNodes, HashAdd, HashCnt, HashCol, THashCol,
- X FHashCnt, FHashAdd;
- X extern short HashDepth, HashMoveLimit;
- X extern struct GameRec GameList[];
- X extern short GameCnt, Game50;
- X extern short Sdepth, MaxSearchDepth;
- X extern int Book;
- X extern struct TimeControlRec TimeControl;
- X extern short TCflag, TCmoves, TCminutes, TCseconds, OperatorTime;
- X extern short XCmore, XCmoves[], XCminutes[], XCseconds[], XC;
- X extern const short otherside[];
- X extern const short Stboard[];
- X extern const short Stcolor[];
- X extern unsigned short hint;
- X extern short int TOflag;
- X extern short stage, stage2, Developed[];
- X extern short ChkFlag[], CptrFlag[], PawnThreat[];
- X extern short Pscore[], Tscore[];
- X extern short rehash;
- X#define MAXrehash (42)
- X extern unsigned int ttblsize;
- X extern short mtl[], pmtl[], hung[], emtl[];
- X extern short Pindex[];
- X extern short PieceCnt[];
- X extern short FROMsquare, TOsquare;
- X extern short HasKnight[], HasBishop[], HasRook[], HasQueen[];
- X extern const short qrook[];
- X extern const short krook[];
- X extern const short kingP[];
- X extern const short rank7[];
- X extern const short sweep[];
- X extern const short epmove1[], epmove2[];
- X extern unsigned short killr0[], killr1[];
- X extern unsigned short killr2[], killr3[];
- X extern unsigned short PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit;
- X extern short killt[];
- X extern short mtl[2], pmtl[2], hung[2];
- X extern const short value[];
- X extern const short control[];
- X extern unsigned char nextpos[8][64][64];
- X extern unsigned char nextdir[8][64][64];
- X extern const short ptype[2][8];
- X extern long filesz;
- X extern FILE *hashfile;
- X extern unsigned int starttime;
- X extern short distdata[64][64], taxidata[64][64];
- X extern short bookcount;
- X extern unsigned long hashkey, hashbd;
- X extern struct hashval hashcode[2][7][64];
- X extern char *CP[];
- X#ifdef QUIETBACKGROUND
- X extern short background;
- X#endif /* QUIETBACKGROUND */
- X
- X#ifdef ttblsz
- X extern struct hashentry huge ttable[2][vttblsz + MAXrehash];
- X
- X#endif
- X
- X/*
- X * hashbd contains a 32 bit "signature" of the board position. hashkey
- X * contains a 16 bit code used to address the hash table. When a move is
- X * made, XOR'ing the hashcode of moved piece on the from and to squares with
- X * the hashbd and hashkey values keeps things current.
- X */
- X#define UpdateHashbd(side, piece, f, t) \
- X{\
- X if ((f) >= 0)\
- X {\
- X hashbd ^= hashcode[side][piece][f].bd;\
- X hashkey ^= hashcode[side][piece][f].key;\
- X }\
- X if ((t) >= 0)\
- X {\
- X hashbd ^= hashcode[side][piece][t].bd;\
- X hashkey ^= hashcode[side][piece][t].key;\
- X }\
- X}
- X
- X
- X extern short rpthash[2][256];
- X extern char *DRAW;
- X
- X#define distance(a,b) distdata[a][b]
- X#define row(a) ((a) >> 3)
- X#define column(a) ((a) & 7)
- X#define locn(a,b) (((a) << 3) | (b))
- X extern short distdata[64][64];
- X
- X/* init external functions */
- X extern void NewGame (void);
- X extern int parse (FILE * fd, short unsigned int *mv, short int side, char *opening);
- X extern void GetOpenings (void);
- X extern int OpeningBook (unsigned short int *hint, short int side);
- X extern void SelectMove (short int side, short int iop);
- X extern int
- X search (short int side,
- X short int ply,
- X short int depth,
- X short int alpha,
- X short int beta,
- X short unsigned int *bstline,
- X short int *rpt);
- X#if ttblsz
- X extern int
- X ProbeTTable (short int side,
- X short int depth,
- X short int ply,
- X short int *alpha,
- X short int *beta,
- X short int *score);
- X extern int
- X PutInTTable (short int side,
- X short int score,
- X short int depth,
- X short int ply,
- X short int alpha,
- X short int beta,
- X short unsigned int mv);
- X extern void ZeroTTable (void);
- X extern void ZeroRPT (void);
- X extern void Initialize_ttable (void);
- X#ifdef HASHFILE
- X extern unsigned int urand (void);
- X extern void srand (unsigned int);
- X extern int
- X ProbeFTable (short int side,
- X short int depth,
- X short int ply,
- X short int *alpha,
- X short int *beta,
- X short int *score);
- X extern void
- X PutInFTable (short int side,
- X short int score,
- X short int depth,
- X short int ply,
- X short int alpha,
- X short int beta,
- X short unsigned int f,
- X short unsigned int t);
- X
- X#endif /* HASHFILE */
- X#endif /* ttblsz */
- X extern void Initialize_moves (void);
- X extern void MoveList (short int side, short int ply);
- X extern void CaptureList (short int side, short int ply);
- X extern int castle (short int side, short int kf, short int kt, short int iop);
- X extern void
- X MakeMove (short int side,
- X struct leaf * node,
- X short int *tempb,
- X short int *tempc,
- X short int *tempsf,
- X short int *tempst,
- X short int *INCscore);
- X extern void
- X UnmakeMove (short int side,
- X struct leaf * node,
- X short int *tempb,
- X short int *tempc,
- X short int *tempsf,
- X short int *tempst);
- X extern void InitializeStats (void);
- X extern int
- X evaluate (short int side,
- X short int ply,
- X short int alpha,
- X short int beta,
- X short int INCscore,
- X short int *slk,
- X short int *InChk);
- X extern short int ScorePosition (short int side);
- X extern void ExaminePosition (void);
- X extern void UpdateWeights (void);
- X extern void Initialize (void);
- X extern void InputCommand (void);
- X extern void ExitChess (void);
- X extern void ClrScreen (void);
- X extern void SetTimeControl (void);
- X extern void SelectLevel (void);
- X extern void
- X UpdateDisplay (short int f,
- X short int t,
- X short int flag,
- X short int iscastle);
- X extern void ElapsedTime (short int iop);
- X extern void ShowSidetoMove (void);
- X extern void SearchStartStuff (short int side);
- X extern void ShowDepth (char ch);
- X extern void TerminateSearch (int);
- X extern void
- X ShowResults (short int score,
- X short unsigned int *bstline,
- X char ch);
- X extern void PromptForMove (void);
- X extern void SetupBoard (void);
- X extern void algbr (short int f, short int t, short int flag);
- X extern void OutputMove (void);
- X extern void ShowCurrentMove (short int pnt, short int f, short int t);
- X extern void ListGame (void);
- X extern void ShowMessage (char *s);
- X extern void ClrScreen (void);
- X extern void gotoXY (short int x, short int y);
- X extern void ClrEoln (void);
- X extern void DrawPiece (short int sq);
- X extern void UpdateClocks (void);
- X extern void ShowLine (short unsigned int *bstline);
- X extern void pick (short int p1, short int p2);
- X extern int TrComp (struct leaf * a, struct leaf * b);
- END_OF_FILE
- if test 17641 -ne `wc -c <'src/gnuchess.h'`; then
- echo shar: \"'src/gnuchess.h'\" unpacked with wrong size!
- fi
- # end of 'src/gnuchess.h'
- fi
- echo shar: End of archive 9 \(of 12\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 12 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- echo Building book file.
- cat misc/book.xaa misc/book.xab > misc/gnuchess.nunn.book
- rm misc/book.xaa misc/book.xab
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-