1NEWS of GNU Chess
2
3  Copyright (C) 2001-2021 Free Software Foundation, Inc.
4
5  Copying and distribution of this file, with or without modification,
6  are permitted in any medium without royalty provided the copyright
7  notice and this notice are preserved.
8
9Version 6.2.9 (July 2021)
10
11- Fixed potential buffer overflow in pgnload and pgnreplay (CVE-2021-30184)
12
13Version 6.2.8 (May 2021)
14
15- Bug fixes in the input/output processing.
16
17Version 6.2.7 (May 2020)
18
19- Minor fixes in the build system.
20
21Version 6.2.6 (April 2020)
22
23- Fix buffer overflow on load EPD file.
24- Fix move validation when cleaning up moves, e.g. accepting '0-0'
25for O-O'.
26- More consistent use of period in translatable texts.
27- Minor fixes on compilation warnings.
28- New and updated translations.
29
30Version 6.2.5 (July 2017)
31
32- Command history based on readline.
33- New commands: coords/nocoords to enable/disable coordinates
34when printing the board.
35- Command pgnsave will prompt the user to overwrite or not an existing
36file instead of appending the current game to the file.
37- New languages.
38- Bug fixes.
39
40Version 6.2.4 (October 2016)
41
42- Print error for invalid move.
43- Truncate user input if longer than 128 characters.
44
45Version 6.2.3 (September 2016)
46
47- Quit after compiling book with option -a (--addbook).
48- Updated translations.
49
50Version 6.2.2 (October 2015)
51
52- More robust program exit concerning threads.
53- Detailed error messages for bad FEN syntax.
54
55Version 6.2.1 (January 2015)
56
57- Man page in English.
58
59Version 6.2.0 (January 2015)
60
61- "Tighter connection" with XBoard by means of an engine file and a
62logo, as expected by XBoard (>= 4.6.0).
63- Some cleanup (typos in info and removed trailing spaces in sources).
64- Uppercase chars only for piece names, as Fruit doesn't like lowercase.
65- A man page based on help2man.
66
67Version 6.1.2 (July 2014)
68
69- CFLAGS replaced by CPPFLAGS in info.
70- Fix for correct handling of castling moves.
71- Include translations to other languages.
72
73Version 6.1.1 (November 2013)
74
75- Include translations to other languages.
76- Minor corrections in translatable strings.
77- Migrate frontend to C++.
78- Use autoconf 2.69 and require it in configure.ac.
79- Use automake 1.14.
80
81Version 6.1.0 (November 2013)
82
83- Add support for package internationalization based on GNU gettext.
84- Include first translations provided by the Translation Team.
85- Graphic mode, a new board shape based on the unicode characters
86for chess.
87- pgnreplay command, similar to pgnload, with the capability of
88manually showing a saved game step by step and moving backwards.
89- Fix bug in setboard.
90- Avoid using 100% CPU in UCI mode.
91- Rename the small book.bin as smallbook.bin.
92
93Version 6.0.93 (October 2013, pretest version of v6.1.0)
94
95- Fix gettext support.
96
97Version 6.0.92 (August 2013, pretest version of v6.1.0)
98
99- Fix gettext support.
100
101Version 6.0.91 (August 2013, pretest version of v6.1.0)
102
103- Fix gettext support.
104
105Version 6.0.90 (August 2013, pretest version of v6.1.0)
106
107- Add support for package internationalization based on GNU gettext.
108- Graphic mode, a new board shape based on the unicode characters
109for chess.
110- pgnreplay command, similar to pgnload, with the capability of
111manually showing a saved game step by step and moving backwards.
112- Fix bug in setboard.
113- Avoid using 100% CPU in UCI mode.
114- Rename the small book.bin as smallbook.bin.
115
116Version 6.0.3 (March 2013)
117
118- Run autoreconf and configure based on autoconf 2.69 and automake 1.13
119to get rid of these vulnerabilies:
120  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4029
121  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3386
122- Update configure.ac to automake 1.13.
123- If in manual mode, keep it after undo.
124- Remove some unused code.
125- Avoid crashing when importing book_1.01.pgn
126
127Version 6.0.2 (March 2012)
128
129- New option --addbook to compile a book.
130- Maximum file name length of EPD files extended to 127 characters.
131- Book file allowed to be read only unless the BookLearn option is set.
132
133Version 6.0.1 (August 2011)
134
135- Allow kibitz for solve command.
136- If gnuchess.ini is not found, report error before prompt.
137- Fix 'book on' command.
138- Fix 'book add' command.
139- Insert sleep(0) in adapter thread - prevents from crash for
140solveepd with st 30.
141- Typo in info file: 'book.dat' replaced by 'book.bin'.
142- Correct INSTALL: 'cd src' before './gnuchess'
143- Remove some unused code.
144
145Version 6.0.0 (27 April 2011)
146
147- First official release of GNU Chess version 6!
148- iq6.epd no longer included in the distribution - stored in Subversion.
149
150Version 5.9.92 (24 April 2011)
151
152- Implement 'book *' commands as in v5.
153    (Implemented by extending the protocol messages between frontend and
154    adapter. Engine book options uncontrollable, since I am more reluctant
155    to modify the protocol between adapter and engine (UCI), but it could
156    be done.)
157- Implement v5 command 'hash on/off'.
158    (UseTrans to be variable and driven by new option.)
159- Implement v5 command 'null on/off'.
160    (UCI option NullMove Pruning)
161- Implement v5 command memory.
162    (UCI option UseTrans)
163- Implement v5 command memory N.
164    (UCI option Hash)
165- Remove v5 commands hashsize/hashsize N. Memory command replaces them.
166- Hard mode at startup.
167- Implement v5 command-line options not working in the previous version:
168    --post
169    --easy
170    --manual
171    --memory
172- All pieces of text doc transformed into texinfo.
173- Include v5 script gnuchessx for xboard mode.
174- Implement script gnuchessu for UCI mode, similar to gnuchessx.
175- Set writing to adapter.log to false by default.
176- Default config so that the config file gnuchess.ini is not mandatory.
177
178Version 5.9.91 (14 January 2011)
179
180- Relax dependency on config file gnuchess.ini
181
182New in gnuchess 5.9.90 (10 January 2011, first pretest version of v6.0.0)
183
184- Fruit 2.1 engine, by Fabien Letouzy
185- Polyglot 1.4 adapter, by Fabien Letouzy
186- Three decoupled components: frontend, engine and adapter
187- UCI mode, providing UCI interface, through -u/--uci command-line option.
188
189New in gnuchess 5.07:
190
191- New PGN parser handles annotated PGN when creating opening book
192- Additional command line options
193- gnuchessx script added
194
195New in gnuchess 5.06:
196
197- Added code for pondering and analysis mode
198- Added white/black commands for use with icsDrone
199- Command line options now follow GNU standards (./gnuchess --help)
200- Some optimisations added
201- Book may be stored in /usr/share/games/gnuchess/book.dat
202- Program no longer starts search from scratch every move
203
204New in gnuchess 5.05:
205
206- Fixed a potential buffer overflow in pgn.c.
207- General code cleanups, bug fixes, and probably introduction
208  of new bugs, especially in pondering related code
209- The opening book is now looked for in
210  /usr/lib/games/gnuchess/book.dat if it is not found in the
211  working directory.
212- Changes for easing compilation with MSVC
213- Removed support for the Novag Universal Board. The recommended
214  alternative is to use the winboard driver for this board, which
215  is linked to on http://www.tim-mann.org/extensions.html
216
217New in gnuchess 5.04:
218- Bug fixes (as always)
219
220New in gnuchess 5.03:
221- Bug fixes (The infamous "illegal move" bug should be dead by now.)
222- Architecture independent binary book. Yes, you may now move your
223  binary book around between little and big endian, 32 and 64 bit
224  machines and it should not break.
225- Build system is now automake/autoconf, should ease porting gnuchess
226  to your favorite strange architecture. (Hell, what about gnuchess on
227  cellphones...?)
228
229Version 5.03
230
231  Book handling rewritten, and other major changes collected and applied
232  by Stuart Cracraft before use of CVS. Book need to be remade from PGN.
233
234  List of Grandmasters we "trust" in generating the opening book was
235  extended.
236
237  Contributed Bug fixes - various.
238
239  Code placed under CVS after some minor changes to 5.02.
240  Opening book not placed under CVS - too large.
241
242  Other changes managed under CVS
243
244  Installation instructions corrected "book create" to "book add".
245  Makefile modified to work with OpenBSD make.
246  Use of C++ reserved words as variable names removed for ease of reuse.
247  The C Macro i386 replaced with Endianness test for portability.
248  Lots of unreachable code removed to make it more readable.
249  "#ifdef debug" and "#ifdef never" code removed.
250  Removed problem with "space" on the end of filenames.
251  Handle XBoard SIGINT gracefully (Caused Solaris Xboard problem).
252  Reduced default hashtable size.
253  Deleted Crafty style bad trade code as it was incorrect.
254
255  The calculations for hung and pinned pieces were using stale
256  information in the calculations. All relevant code was removed
257  from the position evaluation routine.
258
259  Fixed loop bound error that allowed King to remain in check!!!
260
261  Made input buffers consistent to stop crash on long commands.
262  Correct hashtable handling of En Passant.
263  Fixed EPD output when loading a game from file with Black to move.
264  Fixed file handling problem extending opening book.
265
266  Various modifications to SortMove to encourage examination of
267  pushing passed pawns, centralisation, before other moves. Some
268  modification have little effect, as the calling of sorting routines
269  is quite complex.
270
271  Added various EPD files for developer testing. These files cannot be
272  included in the released tar file until copyright issues are resolved.
273
274  Removed Outside passed pawn bonus from Evaluate as it was
275  incorrectly in the pawn hash section.
276
277  Removed the chess_faq.html file from the distribution, as this
278  belongs on the GNU web site.
279
280Version 5.02
281
282  Various bug fixes.
283
284Version 5.01
285
286  Sun Mar  4 11:02:52 EST 2001 - book/book.*
287    Stuart Cracraft <cracraftt@gnu.org>
288    Expanded opening book
289
290  Sun Dec 12 11:42:10 EST 1999 - src/version.c
291    Patrick Gundlach <gundlach@irb.cs.uni-dortmund.de>
292    fflush stdout in Xboard startup (i.e. "Chess" herald)
293
294Version 5.00 *** RELEASE ***		(September 30, 1999 - cracraft)
295
296o Found that after first ^C interrupt to running program a second one would
297  exit it. Added a new signal (..) call in EndSearch. Okay now.
298
299o Structure the tree (doc, book, src, etc.)
300
301o Rename the tree from gnuchess5.0 to chess-5.00
302
303o Revise version.h.
304
305o Revised copywrite.
306
307o Revised COPYING (update FSF address).
308
309o Default to post mode (statistics) if not xboard.
310
311Version 5.00j
312     - integrated 1.21k from Kong.
313     - added
314	traditional anti-computer locked pawn structure penalty
315	traditional anti-computer stonewall pawn structure penalty
316	crafty's eight pawns penalty
317	old cobalt's ahopen traditional anti-computer edge-of-board attack
318	center pawns
319	shortened time until queen penalty (4 moves instead of 8)
320     EICS 5/31/99
321	Games:          83
322	Ave.opp:        1882
323	Percent:        77
324	Result:         63W + 4D + 16L = 77 %
325	Rating:         2093
326     FICS 6/15/99
327 	Games:          125
328	Ave.opp:        1766
329	Percent:        81
330	Result:         100W + 10D + 15L = 81 %
331	Rating:         2017
332
333Version 5.00i
334     - use GNU 4.0 eval instead. toss out evaluation.
335     - Win-at-Chess test: 229/300 at 5 seconds per move. 10,949,825 nodes
336	1507 seconds
337     - Add Queen+Piece threat extension from Kong.
338     - WAC: 235/300 at 5 seconds per move. 9,656,161 nodes. 1525 seconds.
339     - Add the whole GNU 4.0 style calling sequence in Evaluate (lazy,
340       single lone king, etc.)
341     - WAC: 213/300 at 5 seconds per move, 17,911,670 nodes. 1437 seconds.
342     - FICS result:
343	Games:          34
344	Ave.opp:        1836
345	Percent:        85
346	Result:         28W + 4D + 2L = 85 %
347	Rating:         2132
348
349Version 5.00h
350     - book.c: when in XBOARD mode, the book needs to be quiet without status.
351     - eval.c: some formatting
352     - Win-at-Chess test: 219/300 at 5 seconds per move. 11,864,883 nodes.
353			  1441.7 seconds (out of 1500 permitted).
354     - eval.c: penalize knight on rim even more.
355               up undevelopment penalty.
356
357Version 5.00g
358     - Add Crafty-style bad-trade code for bad piece exchange penalty.
359
360Version 5.00f
361     - Kong contributed rotated bitboards move generator.
362       It tests 21% faster than the old move generator,
363       yet overall program speed is about 8% slower based
364       on testing.
365     - Added ROOKTRAPPED code for rook trapped by king.
366
367Version 5.00f
368     - BUGFIX: Kong provided a fix to prevent segmentation faults in
369       certain rare positions:
370		6Q1/8/8/4K3/8/8/p7/1k1 w - - bm 1; id 1;
371     - based on analysis of 7 lost games last night it was
372       noted that 6 of these were in positions where the program
373       played other than double king-pawn or double queen-pawn
374       instead opting for non-classical openings, so...
375       fix to always play double-pawn as long as the evaluation resolves
376       to that order of moves once book has been scored.
377       this is done by having the program choose from between the
378       top 2 moves for white's first move (excluding Nf3, but including
379       e4 and d4) and only the top 1 move for black's first move
380       (excluding non-kp/qp replies to KP/QP by white). For odd
381       openings like Reti or Nc3, fairly good moves are picked with
382       the above algorithm, that may be preferable to just having
383       only kp/kp or qp/qp for this algorithm).
384     - BUGFIX: fix problem that resulted in friendly king not being
385       penalized enough for being far from enemy passed pawns.
386     - FEATURE: Add DistMap[m][n] array. This array has all
387       bits turned on that are n squares away from the m square where
388       m is A1..H8. Aids in rapid diagnosis of distances.
389     - FEATURE: Add penalty for every enemy pawn within 3 squares
390       of the friendly king in the opening and middlegame: KINGNEARENEMYPAWN.
391     - FEATURE: Add penalty for no friendly minors or queen within
392       3 squares of king in opening or middlegame: KINGNOSUPPORT.
393	Games: 		27
394	Ave.opp:	1631
395	Percent:	96
396	Result:		26W + 0D + 1L = 96 %
397	Rating:		2132
398
399Version 5.00e (beginning of March)
400     - try increasing pawncover values -- no good.
401     - try diminishing underattack values -- seems good.
402     - add pawn majority/minority calculation
403     - add in better connected passed pawn evaluator
404     - double penalty for open files adjacent to or on king's file if
405       enemy queen present.
406	Games: 		91
407	Ave.opp:	1763
408	Percent:	87
409	Result:		79W + 2D + 10L = 87 %
410	Rating:		2085
411
412Version 5.00d (late February)
413     - cleaned up version prior to all the mods to get rating back.
414     - one night result:
415	Games: 		29
416	Ave.opp:	1616
417	Percent:	89
418	Result:		25W + 2D + 2L = 89 %
419	Rating:		1967
420     - fix up PGN save-to-file routine. Was putting black in result.
421     - ScoreDev returns only if fully developed.
422     - Diminish connected passed pawn penalty.
423	Games: 		104
424	Ave.opp:	1797
425	Percent:	77
426	Result:		80W + 2D + 22L = 77 %
427	Rating:		2008
428
429Version 5.00b (late January)
430     search.c - Razoring.  This applies at depth == 3.  If we are more
431	      than a Q behind and there is no extension, then reduce
432	      the depth by 1. Extended futility pruning.  At depth == 2,
433	      if we are more than 600 points behind and there is no
434	      extension, then we only look at checking moves & captures
435	      which bring the material score back to alpha. Everything
436	      else is pruned away.  This is an extension of the basic
437	      futility pruning which applies at depth == 1.
438     cmd.c  - modify so that all games go to game.nnn and the
439	      log of their searches go to log.nnn where the two
440	      nnn's match.
441     version.c - split off VERSION/etc info into version.h
442     Makefile  - make version.c depend on version.h
443     pgn.c     - have PGNSaveGame record player's names based on "name" command
444     common.h  - adjust knight and bishop values
445     iterate.c - was not taking up to 2 x nominal time per move when in
446		 bad situations. fixed.
447     book.c    - for random choice amongst top N moves of preferred book
448		 now sorts all moves by stored book score and picks
449		 randomly amongst N based. Previous algorithm was flawed.
450     eval.c - add penalties for attacks against ones king in
451            - add OPENGAME heuristic (1/4 pawn reward for positions
452	      in which root position either side has more than 6 pawns
453	      and in the leaf position both sides have <= 6
454	      (idea due to Larry Kaufman and Don Dailey of Socrates)
455	    - lots of work on development scoring.
456     - Win-at-Chess test: 233/300 at 5 seconds per move. 14,940,780 nodes.
457     - Rating went to FICS 2050 with all the positional changes on 1/31/99.
458     - make king attacks per piece to reward multiple attacks to
459       same square by multiple pieces
460     - anti-stonewall
461     - credit protectors in front of king and penalize attackers.
462     - penalize repeat pawn moves before development complete.
463     - rating maintained at FICS 2049.
464
465Version 5.00a (13 Dec 98)
466
467  - integrated with WinBoard 4.0 / Xboard
468  - post/nopost (show iterative deepening)
469  - time controls (level, fischer, sudden-death, time, otim, etc.)
470  - works properly with FICS (Free Internet Chess Server)
471  - added opening book capability.
472  - futility pruning according to Kong.
473  - weak back rank handling for kings
474  - canned attacks against computer's king (via opening A/H file)
475  - penalize early minor piece repeat moves.
476  - wingpawn advance before castling penalty.
477  - Win-at-Chess test: 233/300 at 5 seconds per move. 14,977,757 nodes.
478  - Convert it to properly run on a standard Unix system, not just PC's.
479  - Make it work with "configure".
480  - Distribute to beta-testers
481  -  eval.c - PawnSq[], make penalty for d2/e2/d7/e7 pawns
482	      KingSq, KnightSq, PawnSq improved
483     eval.h - PINNED* worsened
484            - BISHOP_PAIR from 40 to 25. beta tester input.
485  -  iterate.c - disable Hyatt more-time-after-book algorithm
486		 disable Chua's dont-start-every-new-iteration
487  - this version made a 115 point rating jump (to FICS 2030).
488
489****************** BEGIN GNU 5 (Stuart Cracraft) ********************
490
491Version 1.19 (18 Jul 98)
492	a. Found problems when PV not updated when best >= beta; changed this
493	   in both Quiesce() and Search().
494	b. A ValidateBoard() function.
495	c. Bug fix in SwapOff().  In Evaluate(), position with KNN with no
496	   pawns wasn't being scored as 0; done.
497	d. More accurate & faster hung piece evaluation.
498	e. We skip null search when MATERIAL+ValueP <= beta instead of alpha.
499	   This makes more sense as we are only interested in beta.  Also if
500	   the hash table returns an upper bound, the score < beta, so forget
501	   about doing the null test.  This both gives about 6% reduction in
502	   nodes searched.
503	f. In Search(), when doing TTGet, g0 is destroyed even though we use it
504	   in the null test later.  This is fixed.  Passed pawns made less
505	   valuable; increased CONNECTEDPP from 450 to 650 to compensate.
506	g. One-reply extensions should be checked before probing the hash table
507	   otherwise, such a probe will take place at a lesser depth than it
508	   should.  The algorithm to prune if no faster mate is found is
509	   also brought forward to before the hash probe.
510	h. When all root-moves fail low, it is still a good idea to try the
511	   best move found at the last iteration first.
512	i. Sometimes pawn-to-7th rank extensions wasn't being carried out.
513           This is fixed; also these extensions are only done at the leaf only.
514	   If a root move is a recapture, it is extended as well.
515	j. Bonus/penalties for rook behind/in front of passed pawn.  For ending
516	   don't give bonus for rook on open files as rook behind passed pawns
517	   are stronger.
518	k. SwapOff() wasn't handling promotion moves at all; this is now fixed.
519	   Some of the sort algorithm has to be changed to take into account
520	   the update to SwapOff.  Also minor bug fix to AddXrayPiece().
521	l. Penalize side where a pawn base is under attack by opponent's pawn.
522	m. At SearchRoot() we don't need to do any extensions.  For recapture
523	   extensions, we only extend if it is capture of equal or more
524	   material so as to follow sacrifices (e.g QxP+ KxQ etc).
525	n. Bonus for pawn on c6/f6 if opponent king is in the appropriate
526	   corner.
527	o. Extension for useless interposing moves.  Limit recapture extensions
528	   to below Idepth+2.
529	p. For PV's we no longer back it up from the root.  Now the whole
530	   PV is taken from the hash table except for the first move.  This
531	   is a much cleaner way of managing it, saving code in search.
532	   Otherwise, the PV that is return isn't always correct and its
533	   really very difficult to fix.
534	q. There were some bugs with HashKey calculation in move.c, init.c
535	   and hash.c.  These have been fixed.  The idea is that for ALL
536	   positions in a game, the HashKey must be equal to the HashKey
537	   calculated if the positions are epd-loaded.  Got rid of CptrCnt[]
538	   array; I no longer use it for capture extensions.
539	r. King position is now stored in the variable board; we no longer
540	   need to run leadz (board.b[side][king]) anymore, which takes place
541	   in quite a number of places!
542	s. An AttackXTo() routine which generates a bitboard of all pieces
543	   of side which attack a square.  This includes x-rays.  Bug in
544	   GenCheckEscapes() whereby a pawn capturing a checking piece is
545	   not checked for promotion.  When Idepth <= 3, we don't do null
546	   move.  This allows us to catch some mates in 2 which would
547	   otherwise be pruned away by the null move.
548	t. Added in threat extension code.  A mate at any depth is better
549	   than a non-mate score, so it will replace it in the ttable.
550	   More "bug fixes", eg. sometimes null moves terminate the PV,
551	   hopefully this is all fixed in this release.
552	u. A TTGetPV to pull the PV from the hash table.  This works better
553	   than TTGet which can sometimes miss the PV due to the way the
554	   hash tables are managed.
555	v. Bonus for fianchetto bishops.  Minor change to TTPut() whereby
556	   occasionally the same position can occupy both slots but the 2nd
557	   slot has a lower draft.  The 2nd slot is wasted.  This is changed
558	   so that this waste will no longer occur.
559
560Version 1.18 (18 Mar 98)
561	a. In MakeMove(), when a rook is captured, the castling flag has to be
562	   updated too.  This also means that in genmove.c, when generating
563	   castling moves, it is not necessary to check if the rook is on its
564	   original square.  However this check hasn't been removed yet.
565	b. Add "epdsave/save" command.
566	c. Debug code in quiesce.c wasn't being activated; fixed.
567	d. In ttable.c, use & for calculating hashindex rather than the more
568	   expensive modulo operation.  Gain a couple of percent speedup.
569	   Also fix the hashsize command so that it is also a power of 2.
570	   Also get rid of modulo operation everywhere else in the code.
571	e. For connected pawns on 6th/7th rank only apply super bonus when
572	   the enemy only has rooks.
573	   When researching a fail high move & it fail low, immediately set
574	   alpha to -INF and research it.  This assumes that the original move
575	   did not fail high.
576	f. PhasePick() was sometimes trying out the Hashmv twice resulting in
577	   wasted time.  Fixed by making Hashmv[] an array.
578	g. Bug in trade down code fixed.  Also modified the way worstscore
579	   was calculated resulting in a significant speedup in Evaluate().
580	   Fine tune ScoreB().
581	h. Added a FindPins() function which returns a bitboard of all pinned
582	   pieces.  This is used in eval.c for evaluating pinned pieces.
583	i. Modify way in which sorting of captures was done.  This led to a
584	   reduction in the quiescent search speeding things up slightly.
585	j. For killers, only update them if best >= beta; this gives much
586	   improved pruning.  Remove killer updates in SearchRoot().
587	   Remove transposition lookup & updates in SearchRoot().  Got rid of
588	   pbest in SearchRoot().
589	k. In quiesce(), only update the PV if the score > alpha, not when
590	   score > best.  When a mate in N plies have been found, at the N-1
591	   ply, we don't search the opponent moves; we only check to see if
592	   he is mated.  Simplify SearchRoot().
593	l. If the hash table returns an upperbound, then we don't want the
594	   move that is returned, so set Hashmv=0.  This improves pruning.
595	m. SquarePawnMask[] for pawns on 2nd rank is wrong; it is now set to
596	   mask for pawns on 3rd rank as they can advance 2 square.  SwapOff()
597	   used to assume that the side to move is the one moving the piece.
598	   This has been changed to that SwapOff() can be used for any side.
599	   Bug fixed in evaluation of trapped bishop.  Bug in GenCheckEscapes()
600	   whereby an e.p. capture was allowed even if the pawn is pinned;
601	   this is fixed.  A nicer and bigger board.
602	n. For endings with opposite colour bishops, half the score as they
603	   are mostly drawish.  Instead of penalizing weak pawns, give bonus
604	   to pieces which attack weak enemy pawns.  Lots of evaluation tuning.
605	   Commented out ShowThinking() resulting in faster search.  All this
606	   has improved the nodes per second by 50%! Fix bug in MakeMove()
607	   whereby if a R captures another R, the castling flag for the
608	   captured rook is not cleared.
609	o. Updated FindPins() to include more pin situations. Introduce a
610	   variable called computer; this hold the colour that the program
611	   plays.  Make a trapped bishop part of lazy evaluation as it gives a
612	   high penalty.  Promotion weren't taken into account in SortRoot().
613	p. A basic KPK evaluation for certain positions.  Another bug in
614	   GenCheckEscape(); a promotion move to escape check isn't taken into
615	   account.  Introduced a board.pmaterial[] variable which holds the
616           pieces total value for a side.  PHASE is now calculated using only
617	   pieces values.  In Quiesce(), when side is in check we don't prune
618	   even if best >= beta; this is now fixed; when in check, we see if
619	   we are checkmated, if not and there is a beta cut, do it saving
620	   some branches.  History was updated everytime best > alpha; now it		   is updated only when best >= beta, or when a score > alpha has been
621	   found.  All this gives rise to improved pruning about 2-3 %.
622	q. Some fine tuning of passed pawn eval.  Add quiesce move to ttable
623	   so that it can appear in the PV.
624
625Version 1.17 (9 Feb 98)
626	a. Added very elementary hanging piece evaluation.
627	b. For square of the pawn, instead of adding ValueQ - ValueP, we
628	   a fraction of ValueQ based on how far advance the pawn is.  This
629	   is to encourage the pawn to advance and queen.  Fix a bug in
630	   IsLegalMove() whereby an en-passant was considered illegal.
631	c. More accurate hanging piece evaluation.
632	d. IsLegalMove() was missing out enpassant captures.  Fixed.
633	e. Added a ptype[] variable to distinguish between pawn & bpawn;
634	f. In Search(), initialize PVlen before checking for draws.  This fix
635	   problems with illegal moves in the PV (e.g. GMG1.epd 42).
636	g. Renamed Pinned() to PinnedOnKing().  A new Pinned() function will
637	   be written to be more generic.  Minor change to SearchRoot(), the
638	   first move is also moved within the main loop, making things tidy.
639	h. Xboard support.
640	i. In Search(), the first move is also moved into the main loop.  This
641	   is to make the code better suited for adding threat extensions.
642	   Game50 variable wasn't being properly updated; fixed.
643	j. Trapped bishop at A7/H7/A2/H2.  Rook moved before castling is now
644	   penalized.  Minor optimization in eval.c.  More eval tuning.
645	k. Also promotion moves were not being sorted properly; this is fixed.
646	l. board.ep was initialized to 0; now its -1 fixing a bug when
647	   promotion happens at A1 square (square 0).
648	m. Instead of storing the whole board HashKey into the ttable, we now
649	   store the top 32 bits, saving memory.  Same for Pawn table.
650	n. Fix bug in backward pawn detection.  Fix bug in search whereby
651	   sometimes the best move wasn't being properly set.  Fortunately,
652	   this happens quite deep in the tree, so not much improvement might
653	   be seen.  Change the way that scores are returned from the hash
654	   table probe to improve pruning.
655	o. Trade down bonus implemented.  Recaptures extensions modified so
656	   that only recaptures of same value & square are extended.
657	p. In Quiesce(), check for mates as well.
658	q. Killers at ply-2 is also used for sorting.  Reduced tree size
659	   slightly (2-3%).
660	r. Moves in the Quiesce() search were not being recorded in the PV.
661	   This is now fixed.
662	s. Bug fix in evaluation of square of the pawn whereby if the opponent
663	   is on the move, the pawn isn't scored properly.
664	t. Phase pick is implemented.  Code seems to be working.  Also bug
665	   fixes in IsLegalMove() and Evaluate().
666
667Version 1.16 (26 Jan 98)
668	a. Added a Mvboard[] array which returns the number of times a piece
669	   on [sq] have moved.  Use it for penalizing early Q moves.
670	b. ScoreDev() returns only development of side-to-move instead of
671	   white-black.
672	c. Separate Search() into a SearchRoot() which is called at ply==1
673	   and Search().  Some modifications in search.
674	d. Added back GenAtaks() into evaluate when doing slow evaluation.
675	   Modifications in the ScoreX() routines to make use of attack tables.
676	e. Fixed a bug in UnmakeNullMove whereby the board.ep variable wasn't
677	   correctly restored.
678	f. Added the passed BitBoard into the pawn hash table allowing us
679	   to save the passed pawn board into the table.
680	g. In evaluate, when one side has no mating material, make sure the
681	   score is never > 0.
682	h. Added in Square of the pawn evaluation.  Fix a bug in ScoreP whereby
683	   passed pawns information was being changed.  In EvaluateDraw(),
684	   fix a bug whereby 2N vs 2N wasn't a draw.
685	i. Fix a bug which sometimes put an illegal move in the PV.  This
686	   was happening when an EXACTSCORE was returned, but the PVlen was
687	   incorrectly set.
688	j. Lots of changes/tuning to eval.c.
689	k. Added in an IsLegalMove() function to test if a move is legal.
690	l. Added a Pinned() function to test if a piece is pinned against
691	   the King.
692	m. Added a GenCheckEscape() routine to generate move when a king is
693	   in check.  In SearchRoot(), there is no need to check if a move
694	   is legal as all root moves are legal.
695	n. If King is in check, generate check escapes only and if there is
696	   only 1 move, extend by another move.
697
698Version 1.15 (16 Jan 1998)
699	a. Convert AlgbrMove() to return char * rather than void.
700	b. In the quiescent search, use SwapOff() to see if a capture is
701	   futile and prune it.  Removed as it wasn't working well.
702	c. Big bonus for connected passed pawns on the 6/7th rank.  Solves
703	   WAC/2 easily.
704	d. Bug fix and clean up of code in sort.c.  Results in improve capture
705	   sorting and better pruning.  Got rid of DeepExtCnt; not used.
706	e. For search extensions, limit capture to maximum of 2 and checks to
707	   maximum of Idepth, the iteration depth.
708	f. SwapOff() wasn't working for non-captures as pointed out by Stuart.
709	   Fixed SwapOff(); appears to be okay now. Used SwapOff() in capture
710	   move ordering; seems to help a bit.
711	g. In Search(), move the Quiesce() call before the ttable probe.
712	   Slight improvement in pruning and ttable stats are now much higher.
713	h. Still another bug in AddXrayPiece() was fixed.
714	i. Slight change in GenMoves() to speed it up slightly.
715	j. Implemented pawn hash table.  Achieves good increase in nps (25%).
716	k. Added in a SquarePawnMask[] array.  This is to determine if a king
717	   is able to stop a passed in a king and pawns only endgame.
718	l. Material values of 100,350,350,550,1100.  Also some optimizations
719	   in move.c.  PHASE modified for new material values.
720	m. Implemented a two-tier transposition table.  Minimal gain in tree
721	   size reduction.
722	n. Only store non-captures as killers; try killers after captures
723	   in sort.  This gives more than 30% reductions in nodes searched.
724	   Also fix a bug in SortMoves().
725	o. Only give bonus for rook on 7th rank if enemy king is on 8th rank
726	   or there are enemy pawns on 7th rank.  Other bug fixes and tuning
727	   in eval.
728	p. Recognize and penalize backward pawns.
729
730Version 1.14 (3 Jan 98)
731	a. Fixed bug in solve.c whereby the test for a correct solution is not
732	   correctly done (pointed out by Stuart).
733	b. When searching for mates, eval just return MATERIAL saving time.
734	c. Uses EPD format rather than FEN; also clean up ParseEPD; fen.c
735	   now called epd.c
736	d. io.c renamed to output.c.  Game phase is now 1-8 (opening-ending).
737	e. In quiesce(), if a capture cannot bring the score near alpha,
738	   don't search it, speeding things up.
739	f. If we have a rootscore much worst that our previous iteration
740	   rootscore, we continuing searching.  (Fix from Stuart).
741	g. Got rid of nxtline, bstline way of updating the PV.  Instead use
742	   the method in cheops, resulting in much cleaner code.
743	h. Got rid of savePVar[] array and all the code related to it.
744	   What its for, I can't remember.
745	i. SortMoves() takes into account moves towards the centre.  Pruning
746	   is slightly improved.
747	j. AttackFrom() function is added.  This returns the bitboard of
748	   squares attacked by a piece.  Remove GenAtaks() and other code
749	   in eval.c which required the use of attack tables.
750	k. Bug in ScoreDev() whereby an early Queen move which should be
751	   penalized isn't.  Various bug fixes & tuning in eval code.
752	l. PGNReadFromFile() is able to read the 1st game in a pgn file.
753	m. In the null move, instead of searching with window [alpha,beta],
754	   we search with [beta-1,beta].
755	n. Added in a directions[][] array.  This array is used in swap.c
756	   when checking for x-ray pieces.  Added AddXrayPiece() routine
757	   which is used in the static evaluator.
758	o. Got rid of foundPV variable.  It isn't really necessary.
759	p. Don't flag mate score in ttable as exact score; they aren't.
760	q. Change some (best >= alpha) code to (best > alpha) in Search().
761	   What was I thinking of then!?
762
763Note:  From this point on, changes within a release are labelled as a-z.  This
764is also reflected in version.c
765
766Version 1.13 (1 Jan 98)
767	Got rid of history.c.  Killer is stored only if it is a beta cut.
768	Fix bug in pawn eval for isolated pawns and passed pawns.  Functions
769	like ScoreDev & MATERIAL now return the score for side to move instead
770	of score for white.  This also fixed a bug in the null move condition
771	whereby MATERIAL was only seen from white point of view when it should
772	be from the side-to-move view.  Got rid of SlowEval variable speeding
773	up things quite a bit.  GenAtaks() was NOT called in Evaluate(); this
774	is now fixed.
775
776Version 1.12 (27 Dec 97)
777        When a mate in n-ply is found, the search will never go deeper than
778        n-2 ply.  Fix some bugs in search.c.  Mate scores in hashtables are
779	now always flag as EXACTSCORE, fixing some bugs in mates.  At ply 1,
780	we now don't return the hash score if it is an exact score as we
781	need to search the rest of the moves.  In ttable.c, SANMove() should
782	not be called as GenMoves(ply) was never called.  This affected the
783	debug code.  Now algebraic moves are printed rather than SANMove for
784	ttable debug code.  Fix repetition code, now gmg1.ci/42 can be solved.
785	In iterate.c, foundPV should be set to false when a research is
786	being done.  A Hashmv variable is used to store the move return from
787	probing the hash table.  This is use for move sorting.
788
789Version 1.11 (21 Nov 97)
790        Nulls can be toggled on/off.  Worstscore[] is now initialized to
791        -100 instead of infinity.  EvaluateDraw() is called after iterative
792        deepening is over to see if the game is a draw.  New routine
793        ScoreDev() to calculate development separately; "show eval" command
794        will print development score.  Got rid of Developed[2] global variable.
795        Some tweaking in search.c.  The decision to print '&' or '+' for a
796        PV is now in ShowLine().
797
798Version 1.10 (29 Aug 96)
799	KBBK with bishops of the same colour are now recognized as draws.
800	Matescore now starts from 32767 instead of 9999.  INFINITY
801	extended to 32767.  Added Ctrl-C trap so that the search will end
802        instead of aborting the program.  Originally the move returned by
803        a hash probe is added to the history score.  This is removed and
804	the program show much improved pruning.
805
806Version 1.9 (17 Aug 96)
807	Change the way check/recapture extensions are tested; previously
808	check extensions only take place at <= Idepth*2.  Now a total of
809	Idepth+1 check extensions are allowed.  For recapture, a total
810	of 2 extensions are allowed.  This makes the program search deeper.
811	Fix bug whereby a promotion move (e.g. d8=Q or d8Q) was considered
812	illegal if the opponent tried to enter it on the command line.
813	Fixed a bug in the PVS search.
814
815Version 1.8 (12 Aug 96)
816	A lot of leaf struct variables are converted to int, making the
817	program slightly faster.  Search extension for pushing pawns to
818	7th rank.  The SANMove() code is now responsible for determining
819	if a checking move is mate and adds the '#' sign accordingly.
820	This is much cleaner.  Added passed-pawn evaluations.  Fix bug
821	in eval.c where EnemyKing was wrongly initialized.  Added KingSq[]
822	array to help King stay in the corner.  Added primitive development
823	code; if bishops and knights are on original squares, penalize.
824	Got rid of Material() and substitute a macro MATERIAL for speed.
825
826Version 1.7 (5 Aug 96)
827	A nullhashcode was added so that a null move will change the
828	HashKey (a bad bug!).  Repetition code is now working correctly.
829	The enpassant and castling hash codes are now 64 bit hash values
830	instead of being bits in the HashKey.  A lone king evaluator is
831	added in.  This allows the program to perform elementary mates.
832	Got rid of FilterIllegalMoves() in search.  Now all pseudo-legal
833 	moves are tried; they are immediately rejected if it is determined
834	that they are illegal.  An EvaluateDraw() routine is called early
835	in the Search() and Quiesce(); if the position is a known draw
836	(e.g. not enough mating material), no searching is done.  A KBNK()
837	mating routine is added; this seems to be working fine.
838
839Version 1.6 (2 Aug 96)
840	When displaying the PV and the end is reached, see if the rest of
841	the line can be found from the transposition table.  The random
842	number generator is taken from Knuth.  FilterIllegalMoves is called
843	to cull out illegal moves.  This prunes enough branches such that
844	it turns out to be a gain.  Speeded up FilterIllegalMoves().
845	Converted board.ep to short rather than using a BitBoard.  Also
846	fast evaluation is done in Evaluate() rather than quiesce.  Got rid
847	of epsq variable in leaf structure; it wasn't needed as a board.ep
848	already exists.  A bug was introduced when the new random number
849	generator was added; the top ten bits of the hashkey was being
850	corrupted; this is now fixed.  Speeded up null.c code and MakeMove()
851	UnmakeMove() routines.  Got rid of piececap in leaf{} structure;
852	It has been integrated in the the leaf.flag variable.  The leaf.f
853	and leaf.t variable has been merged into the leaf.mv variable.
854
855Version 1.5 (29 Jul 96)
856	Mate stored in the transposition table need to be offset by (+-ply).
857	Pruning via killer moves has been improved.  A new HistoryStore()
858	is created for code dealing with history & killer.  InChk and
859	GenMoves() are no longer needed in quiesce().  All that work is the
860	responsibility of the full-width search.  Much improved pruning.
861	The flag structure was replaced by an unsigned long.  Got rid of the
862	ExScore variable.  Now all calls to Evaluate() will yield the exact
863	score.
864
865Version 1.4 (19 Jul 96)
866	Check for repetition in search (code currently not working).
867	Added in transposition table code.  Currently there is no rehashing
868	done.  The whole PV was returned to the top of the tree.
869
870Version 1.3 (16 Jul 96)
871	For null moves, if the current material+pawn value is less than
872	alpha, then we don't try the null move test.  The reason is that
873	since our position is already so poor, when playing a null move,
874	our score is going to be less (unless the position is zugzwang).
875	So its not going to be a beta-cut neither is it likely to improve
876	alpha.  This appears to reduce the nodecount.  Added a flag.ended
877	variable to the flag structure.  When this is true, the game has
878	ended and typing go will produce nothing.
879
880Version 1.2 (13 Jul 96)
881	For sort captures, a recapture is always tried before another
882	capture of the same value.  This gives slightly better pruning.
883	Material for white & black is updated incrementally in make/unmake
884	move.  This speeded up the program significantly.  Stalemates are
885	recognized during the search and a score of 0 is returned.
886
887Version 1.1 (19 Feb 96)
888	Added in the NULL move heuristics.  Currently the null move
889	depth reduction is 2.
890
891Version 1.0 (17 Feb 96)		(Chua Kong Sian)
892	This version plays a legal game of chess.  It supports all the
893	special moves (en passant, castling and promotion/underpromotion).
894	It uses the standard PVS search algorithm and incorporates the
895	fail-soft alpha-beta enhancement which gives tighter alpha-beta
896	bounds.  All evaluations are only done at the end-points.
897	Move ordering is by captures first and also history heuristics.
898