home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume13 / gnuchss4 / patch1b < prev    next >
Encoding:
Internet Message Format  |  1992-08-02  |  57.9 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v13i104:  gnuchess4 - GNU Chess 4.0, Patch1b
  5. Message-ID: <3080@master.CNA.TEK.COM>
  6. Date: 22 Jun 92 16:20:00 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2142
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: cracraft@rice-chex.ai.mit.edu (Stuart Cracraft)
  12. Posting-number: Volume 13, Issue 104
  13. Archive-name: gnuchess4/Patch1b
  14. Patch-To: gnuchess4: Volume 13, Issue 89-100
  15. Environment: 
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 2 (of 2)."
  26. # Contents:  patch01.02
  27. # Wrapped by billr@saab on Mon Jun 22 09:09:36 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'patch01.02' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'patch01.02'\"
  31. else
  32. echo shar: Extracting \"'patch01.02'\" \(55335 characters\)
  33. sed "s/^X//" >'patch01.02' <<'END_OF_FILE'
  34. Xdiff -c ../../../../gnuchess4/src/Makefile src/Makefile
  35. X*** ../../../../gnuchess4/src/Makefile    Sun May 31 09:14:22 1992
  36. X--- src/Makefile    Thu Jun 18 15:18:30 1992
  37. X***************
  38. X*** 28,35 ****
  39. X  # gnuchessx is the xchess based chess.
  40. X  #
  41. X  
  42. X! # The version number of this release
  43. X  VERS=    4.0
  44. X  
  45. X  # Relevant file areas.
  46. X  DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  47. X--- 28,36 ----
  48. X  # gnuchessx is the xchess based chess.
  49. X  #
  50. X  
  51. X! # The version number of this GNU and Xboard release
  52. X  VERS=    4.0
  53. X+ XVERS = 2.0
  54. X  
  55. X  # Relevant file areas.
  56. X  DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  57. X***************
  58. X*** 37,47 ****
  59. X  # Distribution directory
  60. X  DISTDIR=/tmp_mnt/home/fsf/cracraft/Ch
  61. X  
  62. X  # Change these to something less transitory, like /usr/games, and then
  63. X  # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  64. X  # in $(LIBDIR).
  65. X  # Where the binaries live.
  66. X! BINDIR= /tmp
  67. X  
  68. X  # Where language description, our book, and the persistent hash live.
  69. X  LIBDIR= /tmp
  70. X--- 38,52 ----
  71. X  # Distribution directory
  72. X  DISTDIR=/tmp_mnt/home/fsf/cracraft/Ch
  73. X  
  74. X+ # Programs being distributed
  75. X+ PROGS=gnuchess-$(VERS) xboard-$(XVERS)
  76. X+ #PROGS=gnuchess-$(VERS)
  77. X+ 
  78. X  # Change these to something less transitory, like /usr/games, and then
  79. X  # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  80. X  # in $(LIBDIR).
  81. X  # Where the binaries live.
  82. X! BINDIR= /tmp_mnt/home/fsf/cracraft/Ch
  83. X  
  84. X  # Where language description, our book, and the persistent hash live.
  85. X  LIBDIR= /tmp
  86. X***************
  87. X*** 55,61 ****
  88. X  # -DNOMEMSET if your machine does not support memset
  89. X  # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  90. X  # -DNODYNALPHA don't dynamically adjust alpha
  91. X! # -DNOHISTORY don't use history killer hueristic 
  92. X  # -DNOSCORESPACE don't use Scorespace hueristic
  93. X  # -DOLDXBOARD don't generate underpromote moves
  94. X  # -DGNU3 don't generate underpromote moves
  95. X--- 60,67 ----
  96. X  # -DNOMEMSET if your machine does not support memset
  97. X  # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  98. X  # -DNODYNALPHA don't dynamically adjust alpha
  99. X! # -DHISTORY use history killer hueristic 
  100. X! # -DKILLT use killt killer hueristic 
  101. X  # -DNOSCORESPACE don't use Scorespace hueristic
  102. X  # -DOLDXBOARD don't generate underpromote moves
  103. X  # -DGNU3 don't generate underpromote moves
  104. X***************
  105. X*** 78,86 ****
  106. X  #              16 print move list after each ply of search
  107. X  #              32 print adds to transposition table
  108. X  #              64 print returns from transposition table lookups
  109. X  
  110. X  
  111. X! OPT= -DAG4 -DQUIETBACKGROUND -DNOHISTORY
  112. X  
  113. X  # The hashfile is a record of positions seen. It is used by
  114. X  # GNU Chess to avoid making the same mistakes, a form of learning.
  115. X--- 84,93 ----
  116. X  #              16 print move list after each ply of search
  117. X  #              32 print adds to transposition table
  118. X  #              64 print returns from transposition table lookups
  119. X+ #          256 print search tree as it is generated
  120. X  
  121. X  
  122. X! OPT= -DAG4 -DQUIETBACKGROUND -DHISTORY 
  123. X  
  124. X  # The hashfile is a record of positions seen. It is used by
  125. X  # GNU Chess to avoid making the same mistakes, a form of learning.
  126. X***************
  127. X*** 90,95 ****
  128. X--- 97,103 ----
  129. X  # moves easily and quickly, saving time, and irritating the human
  130. X  # opponent.
  131. X  BOOK=    -DBOOK=\"$(LIBDIR)/gnuchess.book\"
  132. X+ #BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.book.data\"
  133. X  
  134. X  # The language file describes capabilities of the program. Perhaps
  135. X  # it is useful for non-English speaking countries and customizing
  136. X***************
  137. X*** 101,106 ****
  138. X--- 109,115 ----
  139. X  #CC= cc $(OPT)
  140. X  # Use this if you are lucky enough to have GNU CC.
  141. X  CC=    gcc -W $(OPT)
  142. X+ #CC= c89 $(OPT)
  143. X  
  144. X  # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  145. X  # the other.
  146. X***************
  147. X*** 113,118 ****
  148. X--- 122,128 ----
  149. X  #CFLAGS= -O2   -funroll-loops  # gnu cc  2.00 on others
  150. X  #CFLAGS= -O -Aa -DSIGQUIT=_SIGQUIT -DSYSV # HPUX cc 
  151. X  #CFLAGS= -O2  -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  152. X+ #CFLAGS= -O2
  153. X  
  154. X  all : gnuchess gnuchessr gnuchessn gnuchessx gnuchessc postprint gnuan game checkbook checkgame
  155. X  
  156. X***************
  157. X*** 173,184 ****
  158. X          -c genmoves.c -o genmovesX.o
  159. X  
  160. X  book.o: book.c gnuchess.h version.h
  161. X!     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c book.c 
  162. X  bookC.o: book.c gnuchess.h version.h
  163. X      $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  164. X          -c book.c -o bookC.o
  165. X  bookX.o: book.c gnuchess.h version.h
  166. X!     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  -c book.c -o bookX.o
  167. X  
  168. X  ataks.o: ataks.h ataks.c gnuchess.h version.h
  169. X      $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  170. X--- 183,196 ----
  171. X          -c genmoves.c -o genmovesX.o
  172. X  
  173. X  book.o: book.c gnuchess.h version.h
  174. X!     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c book.c 
  175. X  bookC.o: book.c gnuchess.h version.h
  176. X      $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  177. X+           $(BINBOOK) \
  178. X          -c book.c -o bookC.o
  179. X  bookX.o: book.c gnuchess.h version.h
  180. X!     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  $(BINBOOK) \
  181. X!         -c book.c -o bookX.o
  182. X  
  183. X  ataks.o: ataks.h ataks.c gnuchess.h version.h
  184. X      $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  185. X***************
  186. X*** 254,266 ****
  187. X  
  188. X  distribution:
  189. X      -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  190. X!     echo "patchlevel is $$patchlevel" ;\
  191. X      cd $(DISTDIR) ;\
  192. X      rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  193. X!     tar cf - gnuchess-$(VERS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  194. X      uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  195. X      rm -f x?? ;\
  196. X!     split -1500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  197. X      for i in x??; do \
  198. X        mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  199. X      done
  200. X--- 266,279 ----
  201. X  
  202. X  distribution:
  203. X      -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  204. X!     echo "GNU patchlevel is $$patchlevel" ;\
  205. X!     xpatchlevel=`cat $(DISTDIR)/xboard-$(XVERS)/patchlevel.h|sed -e "s/#define PATCHLEVEL //"` ;\
  206. X      cd $(DISTDIR) ;\
  207. X      rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  208. X!     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  209. X      uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  210. X      rm -f x?? ;\
  211. X!     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  212. X      for i in x??; do \
  213. X        mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  214. X      done
  215. X***************
  216. X*** 279,282 ****
  217. X      -cp ../misc/gnuchess.lang $(LIBDIR)/gnuchess.lang
  218. X  
  219. X  clean:
  220. X!     -rm -f gnuchessx gnuchessc gnuchess gnuchessr gnuchessn gnuchessd postprint gnuan *.o *~ #*# %*%
  221. X--- 292,298 ----
  222. X      -cp ../misc/gnuchess.lang $(LIBDIR)/gnuchess.lang
  223. X  
  224. X  clean:
  225. X!     -rm -f gnuchessx gnuchessc gnuchess gnuchessr gnuchessn gnuchessd postprint gnuan
  226. X!     -echo $(DISTDIR)
  227. X!     -rm -f $(DISTDIR)/gnuchess-4.0/misc/gnuchess.book.data
  228. X!     -find $(DISTDIR) \( -name '*.o' -o -name '*~' -o -name 'CL*' -o -name 'PATCH*' -o -name '#*#' -o -name '%*%' \) -exec rm -f {} \;
  229. Xdiff -c ../../../../gnuchess4/src/book.c src/book.c
  230. X*** ../../../../gnuchess4/src/book.c    Sun May 31 08:29:30 1992
  231. X--- src/book.c    Wed Jun 17 07:23:49 1992
  232. X***************
  233. X*** 23,29 ****
  234. X  
  235. X  #include "gnuchess.h"
  236. X  extern char mvstr[4][6];
  237. X! short bookcount = 0;
  238. X  static struct bookentry
  239. X  {
  240. X    unsigned long bookkey;
  241. X--- 23,29 ----
  242. X  
  243. X  #include "gnuchess.h"
  244. X  extern char mvstr[4][6];
  245. X! int bookcount = 0;
  246. X  static struct bookentry
  247. X  {
  248. X    unsigned long bookkey;
  249. X***************
  250. X*** 32,38 ****
  251. X    unsigned short hint;
  252. X    unsigned char count;
  253. X    unsigned char flags;
  254. X! } OpenBook[BOOKSIZE];
  255. X  static struct bookentry *BookTable[BKTBLSIZE];
  256. X  void
  257. X  GetOpenings (void)
  258. X--- 32,38 ----
  259. X    unsigned short hint;
  260. X    unsigned char count;
  261. X    unsigned char flags;
  262. X! } *OpenBook;
  263. X  static struct bookentry *BookTable[BKTBLSIZE];
  264. X  void
  265. X  GetOpenings (void)
  266. X***************
  267. X*** 44,49 ****
  268. X--- 44,52 ----
  269. X   * next line and entry->move pointing to a chunk of memory containing the
  270. X   * moves. More Opening lines of up to 100 half moves may be added to
  271. X   * gnuchess.book.
  272. X+  * But now its a hashed table by position which yields a move or moves for 
  273. X+  * each position. It no longer knows about openings per say only positions
  274. X+  * and recommended moves in those positions.
  275. X   */
  276. X  #ifndef BOOK
  277. X  #define BOOK "/usr/games/lib/gnuchess.book"
  278. X***************
  279. X*** 57,70 ****
  280. X    short int xside, doit, c, side;
  281. X    short int rf, rt;
  282. X    unsigned short mv;
  283. X  
  284. X- 
  285. X-   for (OB = OpenBook; OB < &OpenBook[BOOKSIZE]; OB++)
  286. X-     OB->count = 0;
  287. X    for (i = 0; i < BKTBLSIZE; i++)
  288. X      {
  289. X        BookTable[i] = &OpenBook[BOOKSIZE / BKTBLSIZE * i];
  290. X      }
  291. X    if ((fd = fopen (BOOK, "r")) == NULL)
  292. X      fd = fopen ("gnuchess.book", "r");
  293. X    if (fd != NULL)
  294. X--- 60,101 ----
  295. X    short int xside, doit, c, side;
  296. X    short int rf, rt;
  297. X    unsigned short mv;
  298. X+   int bs;
  299. X+   unsigned long ltmp;
  300. X+   /* allocate space for the book */
  301. X+   OpenBook = malloc(BOOKSIZE*sizeof(struct bookentry));
  302. X  
  303. X    for (i = 0; i < BKTBLSIZE; i++)
  304. X      {
  305. X        BookTable[i] = &OpenBook[BOOKSIZE / BKTBLSIZE * i];
  306. X      }
  307. X+ #ifdef BINBOOK
  308. X+   fd = fopen (BINBOOK, "r");
  309. X+   if (fd != NULL)
  310. X+     {
  311. X+       fscanf(fd, "%d\n", &bs);
  312. X+       fscanf(fd, "%d\n", &bookcount);
  313. X+       if (bs == BOOKSIZE)
  314. X+     {
  315. X+       if(0>fread(OpenBook, sizeof(struct bookentry), BOOKSIZE, fd))
  316. X+         perror("fread");
  317. X+       /* set every thing back to start game */
  318. X+       Book = BOOKFAIL;
  319. X+       for (i = 0; i < 64; i++)
  320. X+         {
  321. X+           board[i] = Stboard[i];
  322. X+           color[i] = Stcolor[i];
  323. X+         }
  324. X+       fclose(fd);
  325. X+       return;
  326. X+       
  327. X+     }
  328. X+       fclose(fd);
  329. X+     }
  330. X+ #endif
  331. X+ 
  332. X+   for (OB = OpenBook; OB < &OpenBook[BOOKSIZE]; OB++)
  333. X+     OB->count = 0;
  334. X    if ((fd = fopen (BOOK, "r")) == NULL)
  335. X      fd = fopen ("gnuchess.book", "r");
  336. X    if (fd != NULL)
  337. X***************
  338. X*** 106,112 ****
  339. X              && (OB->flags & SIDEMASK) == side
  340. X              && OB->bmove == mv)
  341. X            {
  342. X! 
  343. X              /*
  344. X               * yes so just bump count - count is used to choose
  345. X               * opening move in proportion to its presence in the
  346. X--- 137,143 ----
  347. X              && (OB->flags & SIDEMASK) == side
  348. X              && OB->bmove == mv)
  349. X            {
  350. X!             
  351. X              /*
  352. X               * yes so just bump count - count is used to choose
  353. X               * opening move in proportion to its presence in the
  354. X***************
  355. X*** 114,119 ****
  356. X--- 145,152 ----
  357. X               */
  358. X              doit = false;
  359. X              OB->count++;
  360. X+             if (OB->count < 1)
  361. X+               OB->count--;
  362. X              break;
  363. X            }
  364. X          /* Book is hashed into BKTBLSIZE chunks based on hashkey */
  365. X***************
  366. X*** 198,203 ****
  367. X--- 231,243 ----
  368. X  
  369. X        }
  370. X        fclose (fd);
  371. X+ #ifdef BINBOOK
  372. X+       fd = fopen (BINBOOK, "w");
  373. X+       fprintf(fd, "%d\n%d\n", BOOKSIZE, bookcount);
  374. X+       if(0>fwrite(OpenBook, sizeof(struct bookentry), BOOKSIZE, fd))
  375. X+     perror("fwrite");
  376. X+       fclose (fd);
  377. X+ #endif
  378. X  #if !defined CHESSTOOL && !defined XBOARD
  379. X        sprintf (msg, CP[213], bookcount, BOOKSIZE);
  380. X        ShowMessage (msg);
  381. X***************
  382. X*** 222,228 ****
  383. X  
  384. X  int
  385. X  OpeningBook (unsigned short *hint, short int side)
  386. X! 
  387. X  /*
  388. X   * Go thru each of the opening lines of play and check for a match with the
  389. X   * current game listing. If a match occurs, generate a random number. If this
  390. X--- 262,268 ----
  391. X  
  392. X  int
  393. X  OpeningBook (unsigned short *hint, short int side)
  394. X!      
  395. X  /*
  396. X   * Go thru each of the opening lines of play and check for a match with the
  397. X   * current game listing. If a match occurs, generate a random number. If this
  398. X***************
  399. X*** 245,251 ****
  400. X    tcnt = 0;
  401. X    ccnt = 0;
  402. X    OC = NULL;
  403. X! 
  404. X  
  405. X    /*
  406. X     * find all the moves for this position  - count them and get their total
  407. X--- 285,291 ----
  408. X    tcnt = 0;
  409. X    ccnt = 0;
  410. X    OC = NULL;
  411. X!   
  412. X  
  413. X    /*
  414. X     * find all the moves for this position  - count them and get their total
  415. Xdiff -c ../../../../gnuchess4/src/checkgame.c src/checkgame.c
  416. X*** ../../../../gnuchess4/src/checkgame.c    Sat May 30 07:34:01 1992
  417. X--- src/checkgame.c    Fri Jun  5 23:52:12 1992
  418. X***************
  419. X*** 465,471 ****
  420. X      }
  421. X        return (locn (r1, c1) << 8) | locn (r2, c2);
  422. X      }
  423. X!   return (0);
  424. X  }
  425. X  
  426. X  void
  427. X--- 465,471 ----
  428. X      }
  429. X        return (locn (r1, c1) << 8) | locn (r2, c2);
  430. X      }
  431. X!   /* return (0); */
  432. X  }
  433. X  
  434. X  void
  435. X***************
  436. X*** 690,696 ****
  437. X    if (argc > 4 || argc < 2)
  438. X      {
  439. X        printf ("Usage: game file [start [end] ] \n");
  440. X!       exit ();
  441. X      }
  442. X    start = end = 0;
  443. X  
  444. X--- 690,696 ----
  445. X    if (argc > 4 || argc < 2)
  446. X      {
  447. X        printf ("Usage: game file [start [end] ] \n");
  448. X!       exit (1);
  449. X      }
  450. X    start = end = 0;
  451. X  
  452. X***************
  453. X*** 760,766 ****
  454. X            printf (" %s\n", mvstr);
  455. X          }
  456. X        DISP ();
  457. X!       exit ();
  458. X      }
  459. X        getboard (i);
  460. X        if (board[to] == pawn)
  461. X--- 760,766 ----
  462. X            printf (" %s\n", mvstr);
  463. X          }
  464. X        DISP ();
  465. X!       exit (1);
  466. X      }
  467. X        getboard (i);
  468. X        if (board[to] == pawn)
  469. X***************
  470. X*** 783,789 ****
  471. X      {
  472. X        printf ("Badnews: you have no king\n");
  473. X        DISP ();
  474. X!       exit ();
  475. X      }
  476. X        for (ii = 0; ii < 64; ii++)
  477. X      {
  478. X--- 783,789 ----
  479. X      {
  480. X        printf ("Badnews: you have no king\n");
  481. X        DISP ();
  482. X!       exit (1);
  483. X      }
  484. X        for (ii = 0; ii < 64; ii++)
  485. X      {
  486. X***************
  487. X*** 801,807 ****
  488. X                algbr (Tree[jj].f, Tree[jj].t, 0);
  489. X                printf ("move is %s\n", mvstr);
  490. X                DISP ();
  491. X!               exit ();
  492. X              }
  493. X          }
  494. X          }
  495. X--- 801,807 ----
  496. X                algbr (Tree[jj].f, Tree[jj].t, 0);
  497. X                printf ("move is %s\n", mvstr);
  498. X                DISP ();
  499. X!               exit (1);
  500. X              }
  501. X          }
  502. X          }
  503. X***************
  504. X*** 812,816 ****
  505. X    printf ("\n\n");
  506. X    printf ("Final board:\n\n");
  507. X    DISP ();
  508. X!   exit ();
  509. X  }
  510. X--- 812,816 ----
  511. X    printf ("\n\n");
  512. X    printf ("Final board:\n\n");
  513. X    DISP ();
  514. X!   exit (0);
  515. X  }
  516. Xdiff -c ../../../../gnuchess4/src/dspcom.c src/dspcom.c
  517. X*** ../../../../gnuchess4/src/dspcom.c    Sun May 31 08:31:19 1992
  518. X--- src/dspcom.c    Thu Jun 18 07:20:15 1992
  519. X***************
  520. X*** 22,27 ****
  521. X--- 22,28 ----
  522. X   */
  523. X  #include "gnuchess.h"
  524. X  #include "ataks.h"
  525. X+ extern short Mwpawn[64], Mbpawn[64], Mknight[2][64], Mbishop[2][64];
  526. X  extern char *version, *patchlevel;
  527. X  char mvstr[4][6];
  528. X  char *InPtr;
  529. X***************
  530. X*** 676,686 ****
  531. X      }
  532. X    else if (GameList[GameCnt].score == -9999)
  533. X      {
  534. X!       fprintf (fd, "%s\n", ColorStr[player ^ 1]);
  535. X      }
  536. X    else if (GameList[GameCnt].score == 9998)
  537. X      {
  538. X!       fprintf (fd, "%s\n", ColorStr[player]);
  539. X      }
  540. X    fclose (fd);
  541. X  }
  542. X--- 677,687 ----
  543. X      }
  544. X    else if (GameList[GameCnt].score == -9999)
  545. X      {
  546. X!       fprintf (fd, "%s\n", ColorStr[player ]);
  547. X      }
  548. X    else if (GameList[GameCnt].score == 9998)
  549. X      {
  550. X!       fprintf (fd, "%s\n", ColorStr[player ^ 1]);
  551. X      }
  552. X    fclose (fd);
  553. X  }
  554. X***************
  555. X*** 759,765 ****
  556. X      {
  557. X        struct leaf *node = &Tree[j];
  558. X        algbr (node->f, node->t, node->flags);
  559. X!       printf ("%s %s %s %s\n", mvstr[0], mvstr[1], mvstr[2], mvstr[3]);
  560. X      }
  561. X  #endif
  562. X  #else
  563. X--- 760,766 ----
  564. X      {
  565. X        struct leaf *node = &Tree[j];
  566. X        algbr (node->f, node->t, node->flags);
  567. X!       printf ("%s %s %s %s %d %x\n", mvstr[0], mvstr[1], mvstr[2], mvstr[3],node->score,node->flags);
  568. X      }
  569. X  #endif
  570. X  #else
  571. X***************
  572. X*** 768,774 ****
  573. X  }
  574. X  
  575. X  void
  576. X!  TestPSpeed (void (*f) (short int side), unsigned j)
  577. X  {
  578. X    short i;
  579. X    long cnt, rate, t1, t2;
  580. X--- 769,775 ----
  581. X  }
  582. X  
  583. X  void
  584. X!  TestPSpeed (short int (*f) (short int side), unsigned j)
  585. X  {
  586. X    short i;
  587. X    long cnt, rate, t1, t2;
  588. X***************
  589. X*** 777,783 ****
  590. X    t1 = time (0);
  591. X    for (i = 0; i < j; i++)
  592. X      {
  593. X!       f (opponent);
  594. X      }
  595. X    t2 = time (0);
  596. X    cnt = j;
  597. X--- 778,784 ----
  598. X    t1 = time (0);
  599. X    for (i = 0; i < j; i++)
  600. X      {
  601. X!       (void) f (opponent);
  602. X      }
  603. X    t2 = time (0);
  604. X    cnt = j;
  605. X***************
  606. X*** 882,888 ****
  607. X          fclose (D);
  608. X        }
  609. X  #endif
  610. X! #if !defined XBOARD && !defined CHESSTOOL
  611. X      if (flag.post)
  612. X        GiveHint ();
  613. X  #endif
  614. X--- 883,889 ----
  615. X          fclose (D);
  616. X        }
  617. X  #endif
  618. X! #if !defined CHESSTOOL
  619. X      if (flag.post)
  620. X        GiveHint ();
  621. X  #endif
  622. X***************
  623. X*** 1120,1126 ****
  624. X        ShowMessage (CP[107]);/*test capturelist*/
  625. X        TestSpeed (CaptureList, 30000);
  626. X        ShowMessage (CP[107]);/*test capturelist*/
  627. X!       TestPSpeed ((void *) ScorePosition, 15000);
  628. X      }
  629. X        else
  630. X  #if !defined NONDSP
  631. X--- 1121,1127 ----
  632. X        ShowMessage (CP[107]);/*test capturelist*/
  633. X        TestSpeed (CaptureList, 30000);
  634. X        ShowMessage (CP[107]);/*test capturelist*/
  635. X!       TestPSpeed (ScorePosition, 15000);
  636. X      }
  637. X        else
  638. X  #if !defined NONDSP
  639. X***************
  640. X*** 1128,1133 ****
  641. X--- 1129,1146 ----
  642. X      ShowPostnValues ();
  643. X        else if (strcmp (s, CP[148]) == 0)    /*debug*/
  644. X      DoDebug ();
  645. X+     else if (strcmp (s, "Mwpawn") == 0)        /*debug*/
  646. X+         DoTable (Mwpawn);
  647. X+     else if (strcmp (s, "Mbpawn") == 0)        /*debug*/
  648. X+         DoTable (Mbpawn);
  649. X+     else if (strcmp (s, "Mwknight") == 0)        /*debug*/
  650. X+         DoTable (Mknight[white]);
  651. X+     else if (strcmp (s, "Mbknight") == 0)        /*debug*/
  652. X+         DoTable (Mknight[black]);
  653. X+     else if (strcmp (s, "Mwbishop") == 0)        /*debug*/
  654. X+         DoTable (Mbishop[white]);
  655. X+     else if (strcmp (s, "Mbbishop") == 0)        /*debug*/
  656. X+         DoTable (Mbishop[black]);
  657. X        else
  658. X  #endif
  659. X      {
  660. X***************
  661. X*** 1204,1210 ****
  662. X      {
  663. X        printf ("ioctl failure is this gcc 2.00? See README %d %d\n", i, errno);
  664. X        perror ("FIONREAD");
  665. X!       exit ();
  666. X      }
  667. X  
  668. X    if (nchar)
  669. X--- 1217,1223 ----
  670. X      {
  671. X        printf ("ioctl failure is this gcc 2.00? See README %d %d\n", i, errno);
  672. X        perror ("FIONREAD");
  673. X!       exit (1);
  674. X      }
  675. X  
  676. X    if (nchar)
  677. Xdiff -c ../../../../gnuchess4/src/eval.c src/eval.c
  678. X*** ../../../../gnuchess4/src/eval.c    Sat May 30 07:35:02 1992
  679. X--- src/eval.c    Wed Jun 17 21:25:56 1992
  680. X***************
  681. X*** 247,253 ****
  682. X  #endif
  683. X  #endif
  684. X  
  685. X! static short Mwpawn[64], Mbpawn[64], Mknight[2][64], Mbishop[2][64];
  686. X  static short Mking[2][64], Kfield[2][64];
  687. X  static short c1, c2, *atk1, *atk2, *PC1, *PC2, atak[2][64];
  688. X  short emtl[2];
  689. X--- 247,253 ----
  690. X  #endif
  691. X  #endif
  692. X  
  693. X! short Mwpawn[64], Mbpawn[64], Mknight[2][64], Mbishop[2][64];
  694. X  static short Mking[2][64], Kfield[2][64];
  695. X  static short c1, c2, *atk1, *atk2, *PC1, *PC2, atak[2][64];
  696. X  short emtl[2];
  697. Xdiff -c ../../../../gnuchess4/src/game.c src/game.c
  698. X*** ../../../../gnuchess4/src/game.c    Sat May 30 19:16:06 1992
  699. X--- src/game.c    Fri Jun  5 23:57:39 1992
  700. X***************
  701. X*** 342,348 ****
  702. X    if (argc > 4 || argc < 2)
  703. X      {
  704. X        printf ("Usage: game file [start [end] ] \n");
  705. X!       exit ();
  706. X      }
  707. X    start = end = 0;
  708. X    if (argc > 2)
  709. X--- 342,348 ----
  710. X    if (argc > 4 || argc < 2)
  711. X      {
  712. X        printf ("Usage: game file [start [end] ] \n");
  713. X!       exit (1);
  714. X      }
  715. X    start = end = 0;
  716. X    if (argc > 2)
  717. X***************
  718. X*** 420,424 ****
  719. X  
  720. X    if (nr)
  721. X      printf ("showpage\n");
  722. X!   exit ();
  723. X  }
  724. X--- 420,424 ----
  725. X  
  726. X    if (nr)
  727. X      printf ("showpage\n");
  728. X!   exit (0);
  729. X  }
  730. Xdiff -c ../../../../gnuchess4/src/genmoves.c src/genmoves.c
  731. X*** ../../../../gnuchess4/src/genmoves.c    Sat May 30 19:16:42 1992
  732. X--- src/genmoves.c    Mon Jun 15 23:10:20 1992
  733. X***************
  734. X*** 55,66 ****
  735. X  
  736. X    node = &Tree[*TrP];
  737. X    mv = (f << 8) | t;
  738. X! #if defined NOHISTORY
  739. X    s = killt[mv | sidebit];
  740. X! #else
  741. X!   z = (f << 6) | t;
  742. X!   if (xside == white)
  743. X!     z |= 0x1000;
  744. X    s = history[z];
  745. X  #endif
  746. X    if (color[t] != neutral)
  747. X--- 55,66 ----
  748. X  
  749. X    node = &Tree[*TrP];
  750. X    mv = (f << 8) | t;
  751. X! #ifdef KILLT
  752. X    s = killt[mv | sidebit];
  753. X! #endif
  754. X! #ifdef HISTORY
  755. X!   z = mv;
  756. X!   if (xside == white) z |= 0x4000;
  757. X    s = history[z];
  758. X  #endif
  759. X    if (color[t] != neutral)
  760. X***************
  761. X*** 172,182 ****
  762. X    *TrP = TrPnt[ply];
  763. X    if (!PV)
  764. X      Swag0 = killr0[ply];
  765. X    Swag1 = killr1[ply];
  766. X    Swag2 = killr2[ply];
  767. X    Swag3 = killr3[ply];
  768. X    if (ply > 2)
  769. X!     Swag4 = killr1[ply - 2];
  770. X    sidebit = ((side == white) ? 0 : 0x80);
  771. X    killt[SwagHt | sidebit] += 5000;
  772. X    killt[Swag0 | sidebit] += 2000;
  773. X--- 172,184 ----
  774. X    *TrP = TrPnt[ply];
  775. X    if (!PV)
  776. X      Swag0 = killr0[ply];
  777. X+    else Swag0 = PV;
  778. X    Swag1 = killr1[ply];
  779. X    Swag2 = killr2[ply];
  780. X    Swag3 = killr3[ply];
  781. X    if (ply > 2)
  782. X!     Swag4 = killr1[ply - 2]; else Swag4 = 0;
  783. X! #ifdef KILLT
  784. X    sidebit = ((side == white) ? 0 : 0x80);
  785. X    killt[SwagHt | sidebit] += 5000;
  786. X    killt[Swag0 | sidebit] += 2000;
  787. X***************
  788. X*** 184,189 ****
  789. X--- 186,201 ----
  790. X    killt[Swag2 | sidebit] += 50;
  791. X    killt[Swag3 | sidebit] += 40;
  792. X    killt[Swag4 | sidebit] += 30;
  793. X+ #endif
  794. X+ #ifdef HISTORY
  795. X+   i = (side == black)?0x4000:0;
  796. X+   history[SwagHt | i] += 5000;
  797. X+   if(SwagHt != Swag0)history[Swag0 | i] += 2000;
  798. X+   if(SwagHt != Swag1 && Swag1 != Swag0)history[Swag1 | i] += 60;
  799. X+   if(SwagHt != Swag2 && Swag0 != Swag2 && Swag1 != Swag2)history[Swag2 | i] += 50;
  800. X+   if(SwagHt != Swag3 && Swag0 != Swag3 && Swag1 != Swag3 && Swag2 != Swag3)history[Swag3 | i] += 40;
  801. X+   if(SwagHt != Swag4 && Swag0 != Swag4 && Swag1 != Swag4 && Swag2 != Swag4 && Swag3 != Swag4)history[Swag4 | i] += 30;
  802. X+ #endif
  803. X    for (i = PieceCnt[side]; i >= 0; i--)
  804. X      GenMoves (ply, PieceList[side][i], side, xside);
  805. X    if (!castld[side])
  806. X***************
  807. X*** 207,212 ****
  808. X--- 219,225 ----
  809. X        if (color[f] == side && board[f] == pawn)
  810. X      LinkMove (ply, f, epsquare, capture | epmask, xside);
  811. X      }
  812. X+ #ifdef KILLT
  813. X    killt[SwagHt | sidebit] -= 5000;
  814. X    killt[Swag0 | sidebit] -= 2000;
  815. X    killt[Swag1 | sidebit] -= 60;
  816. X***************
  817. X*** 213,218 ****
  818. X--- 226,241 ----
  819. X    killt[Swag2 | sidebit] -= 50;
  820. X    killt[Swag3 | sidebit] -= 40;
  821. X    killt[Swag4 | sidebit] -= 30;
  822. X+ #endif
  823. X+ #ifdef HISTORY
  824. X+  i = (side == black)?0x4000:0;
  825. X+   history[SwagHt | i] -= 5000;
  826. X+   if(SwagHt != Swag0)history[Swag0 | i] -= 2000;
  827. X+   if(SwagHt != Swag1 && Swag1 != Swag0)history[Swag1 | i] -= 60;
  828. X+   if(SwagHt != Swag2 && Swag0 != Swag2 && Swag1 != Swag2)history[Swag2 | i] -= 50;
  829. X+   if(SwagHt != Swag3 && Swag0 != Swag3 && Swag1 != Swag3 && Swag2 != Swag3)history[Swag3 | i] -= 40;
  830. X+   if(SwagHt != Swag4 && Swag0 != Swag4 && Swag1 != Swag4 && Swag2 != Swag4 && Swag3 != Swag4)history[Swag4 | i] -= 30;
  831. X+ #endif
  832. X    SwagHt = 0;            /* SwagHt is only used once */
  833. X  }
  834. X  
  835. X***************
  836. X*** 237,242 ****
  837. X--- 260,266 ----
  838. X    node = &Tree[*TrP];
  839. X    r7 = rank7[side];
  840. X    PL = PieceList[side];
  841. X+ #ifdef KILLT
  842. X    sidebit = ((side == white) ? 0 : 0x80);
  843. X    killt[SwagHt | sidebit] += 5000;
  844. X    killt[Swag0 | sidebit] += 2000;
  845. X***************
  846. X*** 244,249 ****
  847. X--- 268,275 ----
  848. X    killt[Swag2 | sidebit] += 50;
  849. X    killt[Swag3 | sidebit] += 40;
  850. X    killt[Swag4 | sidebit] += 30;
  851. X+ #endif
  852. X+ 
  853. X    for (i = 0; i <= PieceCnt[side]; i++)
  854. X      {
  855. X        sq = PL[i];
  856. X***************
  857. X*** 307,312 ****
  858. X--- 333,339 ----
  859. X          }
  860. X      }
  861. X      }
  862. X+ #ifdef KILLT
  863. X    killt[SwagHt | sidebit] -= 5000;
  864. X    killt[Swag0 | sidebit] -= 2000;
  865. X    killt[Swag1 | sidebit] -= 60;
  866. X***************
  867. X*** 313,317 ****
  868. X--- 340,345 ----
  869. X    killt[Swag2 | sidebit] -= 50;
  870. X    killt[Swag3 | sidebit] -= 40;
  871. X    killt[Swag4 | sidebit] -= 30;
  872. X+ #endif
  873. X    SwagHt = 0;            /* SwagHt is only used once */
  874. X  }
  875. Xdiff -c ../../../../gnuchess4/src/gnuan.c src/gnuan.c
  876. X*** ../../../../gnuchess4/src/gnuan.c    Sat May 30 19:17:57 1992
  877. X--- src/gnuan.c    Sun Jun  7 10:58:45 1992
  878. X***************
  879. X*** 93,100 ****
  880. X  #define printz printf
  881. X  
  882. X  char mvstr[4][6];
  883. X! char *ColorStr[2] =
  884. X! {"White", "Black"};
  885. X  int mycnt1, mycnt2;
  886. X  
  887. X  static FILE *fpin;
  888. X--- 93,99 ----
  889. X  #define printz printf
  890. X  
  891. X  char mvstr[4][6];
  892. X! extern char *ColorStr[2];
  893. X  int mycnt1, mycnt2;
  894. X  
  895. X  static FILE *fpin;
  896. X***************
  897. X*** 737,742 ****
  898. X--- 736,742 ----
  899. X  
  900. X    fpout = stderr;
  901. X    fprintf (fpout, "Input the file with the algebraic moves of the game.\n");
  902. X+   fflush(fpout);
  903. X    gets (infilename);
  904. X    fprintf (fpout, "\n");
  905. X    do
  906. X***************
  907. X*** 754,760 ****
  908. X        gets (inbuf);
  909. X        max_minutes = atoi (inbuf);
  910. X    } while (max_minutes < 1);
  911. X!   printf ("%d %d \n", search_depth, max_minutes);
  912. X    TCminutes = max_minutes;
  913. X  
  914. X    fprintf (fpout, "\n\n");
  915. X--- 754,761 ----
  916. X        gets (inbuf);
  917. X        max_minutes = atoi (inbuf);
  918. X    } while (max_minutes < 1);
  919. X!   printf ("\nYou will search to %d half moves\n", search_depth);
  920. X!   printf ("\nWith no search taking more than %d minutes\n",max_minutes);
  921. X    TCminutes = max_minutes;
  922. X  
  923. X    fprintf (fpout, "\n\n");
  924. Xdiff -c ../../../../gnuchess4/src/gnuchess.h src/gnuchess.h
  925. X*** ../../../../gnuchess4/src/gnuchess.h    Sat May 30 19:21:45 1992
  926. X--- src/gnuchess.h    Thu Jun 18 20:56:47 1992
  927. X***************
  928. X*** 21,32 ****
  929. X   * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  930. X   */
  931. X  
  932. X  #include <stdio.h>
  933. X- /* <stdio.h */
  934. X- extern int fclose (FILE *);
  935. X- extern int fscanf (FILE *, const char *,...);
  936. X- extern int fprintf (FILE *, const char *,...);
  937. X- extern int fflush (FILE *);
  938. X  
  939. X  #define SEEK_SET 0
  940. X  #define SEEK_END 2
  941. X--- 21,35 ----
  942. X   * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  943. X   */
  944. X  
  945. X+ #if !defined(__STDC__) || !defined(MSDOS)
  946. X+ #define const
  947. X+ #endif
  948. X+ 
  949. X+ #ifndef __GNUC__
  950. X+ #define inline
  951. X+ #endif
  952. X+ 
  953. X  #include <stdio.h>
  954. X  
  955. X  #define SEEK_SET 0
  956. X  #define SEEK_END 2
  957. X***************
  958. X*** 40,53 ****
  959. X  
  960. X  #endif /* DEBUG */
  961. X  
  962. X- #if !defined(__STDC__) || !defined(MSDOS)
  963. X- #define const
  964. X- #endif
  965. X- 
  966. X- #ifndef __GNUC__
  967. X- #define inline
  968. X- #endif
  969. X- 
  970. X  #include <ctype.h>
  971. X  
  972. X  #ifdef MSDOS
  973. X--- 43,48 ----
  974. X***************
  975. X*** 72,77 ****
  976. X--- 67,81 ----
  977. X  #define printz printw
  978. X  #endif
  979. X  
  980. X+ #if defined(__STDC__) || defined(MSDOS)
  981. X+ /* <stdio.h> */
  982. X+      extern int fclose (FILE *);
  983. X+ #ifndef __ultrix /* work around bug in c89 compiler --t.mann */
  984. X+      extern int fscanf (FILE *, const char *, ...);
  985. X+      extern int fprintf (FILE *, const char *, ...);
  986. X+ #endif /*__ultrix*/
  987. X+      extern int fflush (FILE *);
  988. X+ 
  989. X  /* <stdlib.h> */
  990. X       extern int abs (int);
  991. X       extern int atoi (const char *);
  992. X***************
  993. X*** 81,86 ****
  994. X--- 85,91 ----
  995. X  
  996. X  /* <string.h> */
  997. X       extern void *memset (void *, int, size_t);
  998. X+ #endif
  999. X  
  1000. X  
  1001. X  /* Piece values */
  1002. X***************
  1003. X*** 174,182 ****
  1004. X  #define ttblsz vttblsz
  1005. X  #define TREE 1500        /* max number of tree entries */
  1006. X  #define MAXDEPTH 35        /* max depth a search can be carried */
  1007. X! #define MINDEPTH 2        /* min search depth =1 (no hint), >1 hint */
  1008. X  #define MAXMOVES 400        /* max number of half moves in a game */
  1009. X! #define BOOKSIZE 7500        /* Number of unique position/move combinations allowed */
  1010. X  #define CPSIZE 225        /* size of lang file max */
  1011. X  /***************** tuning paramaters **********************************************/
  1012. X  #define CHKDEPTH 1        /* always look forward CHKDEPTH half-moves if in check */
  1013. X--- 179,187 ----
  1014. X  #define ttblsz vttblsz
  1015. X  #define TREE 1500        /* max number of tree entries */
  1016. X  #define MAXDEPTH 35        /* max depth a search can be carried */
  1017. X! #define MINDEPTH 3        /* min search depth =1 (no hint), >1 hint */
  1018. X  #define MAXMOVES 400        /* max number of half moves in a game */
  1019. X! #define BOOKSIZE 30000        /* Number of unique position/move combinations allowed */
  1020. X  #define CPSIZE 225        /* size of lang file max */
  1021. X  /***************** tuning paramaters **********************************************/
  1022. X  #define CHKDEPTH 1        /* always look forward CHKDEPTH half-moves if in check */
  1023. X***************
  1024. X*** 187,193 ****
  1025. X  #define ZDEPTH 3        /* depth beyond which to check ZDELTA for extra time */
  1026. X  #define ZDELTA 10        /* score delta per ply to cause extra time to be given */
  1027. X  #define ZNODES 1000        /* check the time every ZNODES positions */
  1028. X! #define MAXTCCOUNT 4        /* max number of time clicks per search */
  1029. X  #define MINSEARCHPCT 10        /* must have looked at MINSEARCHPCT moves on a ply on a timeout */
  1030. X  #define SCORETIME -50        /* score below which to add search time */
  1031. X  #define SCORESPLIM 8        /* Score space doesn't apply after this stage */
  1032. X--- 192,198 ----
  1033. X  #define ZDEPTH 3        /* depth beyond which to check ZDELTA for extra time */
  1034. X  #define ZDELTA 10        /* score delta per ply to cause extra time to be given */
  1035. X  #define ZNODES 1000        /* check the time every ZNODES positions */
  1036. X! #define MAXTCCOUNT 5        /* max number of time clicks per search */
  1037. X  #define MINSEARCHPCT 10        /* must have looked at MINSEARCHPCT moves on a ply on a timeout */
  1038. X  #define SCORETIME -50        /* score below which to add search time */
  1039. X  #define SCORESPLIM 8        /* Score space doesn't apply after this stage */
  1040. X***************
  1041. X*** 203,209 ****
  1042. X  #define RBONUS 6        /* points per stage value of R increases */
  1043. X  #define KINGPOSLIMIT ( -1)    /* King positional scoring limit */
  1044. X  #define KINGSAFETY  16
  1045. X! #define MINTIME 200        /* MIN time to start a ply */
  1046. X  
  1047. X  #if defined AG0
  1048. X  #define WHITEAG0
  1049. X--- 208,214 ----
  1050. X  #define RBONUS 6        /* points per stage value of R increases */
  1051. X  #define KINGPOSLIMIT ( -1)    /* King positional scoring limit */
  1052. X  #define KINGSAFETY  16
  1053. X! #define MAXrehash (6)
  1054. X  
  1055. X  #if defined AG0
  1056. X  #define WHITEAG0
  1057. X***************
  1058. X*** 230,236 ****
  1059. X  #define BLACKAG4
  1060. X  #endif
  1061. X  /************************* parameters for Opening Book *********************************/
  1062. X! #define BOOKBITS 6        /* # bits for hashtable to book moves */
  1063. X  #define BOOKFAIL 2        /* if no book move found for BOOKFAIL turns stop using book */
  1064. X  #define BOOKRAND 1000        /* used to select an opening move from a list */
  1065. X  #define BOOKENDPCT 500        /* 50 % chance a BOOKEND will stop the book */
  1066. X--- 235,241 ----
  1067. X  #define BLACKAG4
  1068. X  #endif
  1069. X  /************************* parameters for Opening Book *********************************/
  1070. X! #define BOOKBITS 8        /* # bits for hashtable to book moves */
  1071. X  #define BOOKFAIL 2        /* if no book move found for BOOKFAIL turns stop using book */
  1072. X  #define BOOKRAND 1000        /* used to select an opening move from a list */
  1073. X  #define BOOKENDPCT 500        /* 50 % chance a BOOKEND will stop the book */
  1074. X***************
  1075. X*** 338,345 ****
  1076. X       extern FILE *debugfile;
  1077. X  
  1078. X  #endif /* DEBUG */
  1079. X! #if !defined NOHISTORY
  1080. X!      extern unsigned char history[8192];
  1081. X  #endif
  1082. X       extern char *ColorStr[2];
  1083. X       extern unsigned short int MV[MAXDEPTH];
  1084. X--- 343,350 ----
  1085. X       extern FILE *debugfile;
  1086. X  
  1087. X  #endif /* DEBUG */
  1088. X! #ifdef HISTORY
  1089. X!      extern unsigned char history[32768];
  1090. X  #endif
  1091. X       extern char *ColorStr[2];
  1092. X       extern unsigned short int MV[MAXDEPTH];
  1093. X***************
  1094. X*** 380,386 ****
  1095. X       extern short ChkFlag[], CptrFlag[], PawnThreat[];
  1096. X       extern short Pscore[], Tscore[];
  1097. X       extern short rehash;
  1098. X- #define MAXrehash (42)
  1099. X       extern unsigned int ttblsize;
  1100. X       extern short mtl[], pmtl[], hung[], emtl[];
  1101. X       extern short Pindex[];
  1102. X--- 385,390 ----
  1103. X***************
  1104. X*** 407,413 ****
  1105. X       extern FILE *hashfile;
  1106. X       extern unsigned int starttime;
  1107. X       extern short distdata[64][64], taxidata[64][64];
  1108. X!      extern short bookcount;
  1109. X       extern unsigned long hashkey, hashbd;
  1110. X       extern struct hashval hashcode[2][7][64];
  1111. X       extern char *CP[];
  1112. X--- 411,417 ----
  1113. X       extern FILE *hashfile;
  1114. X       extern unsigned int starttime;
  1115. X       extern short distdata[64][64], taxidata[64][64];
  1116. X!      extern int bookcount;
  1117. X       extern unsigned long hashkey, hashbd;
  1118. X       extern struct hashval hashcode[2][7][64];
  1119. X       extern char *CP[];
  1120. Xdiff -c ../../../../gnuchess4/src/init.c src/init.c
  1121. X*** ../../../../gnuchess4/src/init.c    Sat May 30 19:18:35 1992
  1122. X--- src/init.c    Mon Jun 15 23:02:53 1992
  1123. X***************
  1124. X*** 27,32 ****
  1125. X--- 27,33 ----
  1126. X  
  1127. X  short distdata[64][64], taxidata[64][64];
  1128. X  
  1129. X+ #ifdef KILLT
  1130. X  /* put moves to the center first */
  1131. X  void
  1132. X  Initialize_killt (void)
  1133. X***************
  1134. X*** 56,62 ****
  1135. X      killt[(f << 8) | t | 0x80] = s;
  1136. X        }
  1137. X  }
  1138. X! 
  1139. X  void
  1140. X  Initialize_dist (void)
  1141. X  {
  1142. X--- 57,63 ----
  1143. X      killt[(f << 8) | t | 0x80] = s;
  1144. X        }
  1145. X  }
  1146. X! #endif
  1147. X  void
  1148. X  Initialize_dist (void)
  1149. X  {
  1150. X***************
  1151. X*** 70,76 ****
  1152. X--- 71,79 ----
  1153. X      taxidata[a][b] = d + di;
  1154. X      distdata[a][b] = (d > di ? d : di);
  1155. X        }
  1156. X+ #ifdef KILLT
  1157. X    Initialize_killt ();
  1158. X+ #endif
  1159. X  }
  1160. X  
  1161. X  const short Stboard[64] =
  1162. X***************
  1163. X*** 381,387 ****
  1164. X    if (!constfile)
  1165. X      {
  1166. X        printf ("NO LANGFILE\n");
  1167. X!       exit ();
  1168. X      }
  1169. X    while (fgets (s, sizeof (s), constfile))
  1170. X      {
  1171. X--- 384,390 ----
  1172. X    if (!constfile)
  1173. X      {
  1174. X        printf ("NO LANGFILE\n");
  1175. X!       exit (1);
  1176. X      }
  1177. X    while (fgets (s, sizeof (s), constfile))
  1178. X      {
  1179. X***************
  1180. X*** 394,406 ****
  1181. X        if (q == &s[8])
  1182. X      {
  1183. X        printf ("{ error in cinstfile\n");
  1184. X!       exit ();
  1185. X      }
  1186. X        *q = '\0';
  1187. X        if (s[3] != ':' || s[7] != ':' || s[8] != '{')
  1188. X      {
  1189. X        printf ("Langfile format error %s\n", s);
  1190. X!       exit ();
  1191. X      }
  1192. X        s[3] = s[7] = '\0';
  1193. X        if (lang == NULL)
  1194. X--- 397,409 ----
  1195. X        if (q == &s[8])
  1196. X      {
  1197. X        printf ("{ error in cinstfile\n");
  1198. X!       exit (1);
  1199. X      }
  1200. X        *q = '\0';
  1201. X        if (s[3] != ':' || s[7] != ':' || s[8] != '{')
  1202. X      {
  1203. X        printf ("Langfile format error %s\n", s);
  1204. X!       exit (1);
  1205. X      }
  1206. X        s[3] = s[7] = '\0';
  1207. X        if (lang == NULL)
  1208. X***************
  1209. X*** 414,420 ****
  1210. X        if (entry < 0 || entry >= CPSIZE)
  1211. X      {
  1212. X        printf ("Langfile number error\n");
  1213. X!       exit ();
  1214. X      }
  1215. X        for (q = p = &s[9]; *p; p++)
  1216. X      {
  1217. X--- 417,423 ----
  1218. X        if (entry < 0 || entry >= CPSIZE)
  1219. X      {
  1220. X        printf ("Langfile number error\n");
  1221. X!       exit (1);
  1222. X      }
  1223. X        for (q = p = &s[9]; *p; p++)
  1224. X      {
  1225. Xdiff -c ../../../../gnuchess4/src/main.c src/main.c
  1226. X*** ../../../../gnuchess4/src/main.c    Sat May 30 19:06:35 1992
  1227. X--- src/main.c    Mon Jun 15 23:35:20 1992
  1228. X***************
  1229. X*** 58,65 ****
  1230. X  
  1231. X  char savefile[128] = "";
  1232. X  char listfile[128] = "";
  1233. X! #if !defined NOHISTORY
  1234. X! unsigned char history[8192];
  1235. X  #endif
  1236. X  short rpthash[2][256];
  1237. X  struct leaf Tree[TREE], *root;
  1238. X--- 58,65 ----
  1239. X  
  1240. X  char savefile[128] = "";
  1241. X  char listfile[128] = "";
  1242. X! #ifdef HISTORY
  1243. X! unsigned char history[32768];
  1244. X  #endif
  1245. X  short rpthash[2][256];
  1246. X  struct leaf Tree[TREE], *root;
  1247. X***************
  1248. X*** 107,113 ****
  1249. X--- 107,115 ----
  1250. X  unsigned short killr0[MAXDEPTH], killr1[MAXDEPTH];
  1251. X  unsigned short killr2[MAXDEPTH], killr3[MAXDEPTH];
  1252. X  unsigned short PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit;
  1253. X+ #ifdef KILLT
  1254. X  short killt[0x4000];
  1255. X+ #endif
  1256. X  const short value[7] =
  1257. X  {0, valueP, valueN, valueB, valueR, valueQ, valueK};
  1258. X  const short control[7] =
  1259. X***************
  1260. X*** 117,122 ****
  1261. X--- 119,132 ----
  1262. X  unsigned int starttime;
  1263. X  short int ahead = true, hash = true;
  1264. X  
  1265. X+ #if defined CHESSTOOL || defined XBOARD
  1266. X+ void
  1267. X+ TerminateChess (int sig)
  1268. X+ {
  1269. X+   ExitChess();
  1270. X+ }
  1271. X+ #endif
  1272. X+ 
  1273. X  /* hmm.... shouldn`t main be moved to the interface routines */
  1274. X  int
  1275. X  main (int argc, char **argv)
  1276. X***************
  1277. X*** 256,265 ****
  1278. X        break;
  1279. X      case 'v':
  1280. X        fprintf (stderr, CP[102], version, patchlevel);
  1281. X!       exit ();
  1282. X      default:
  1283. X!       fprintf (stderr, CP[103]);
  1284. X!       exit ();
  1285. X      }
  1286. X        argv++;
  1287. X        argc--;
  1288. X--- 266,275 ----
  1289. X        break;
  1290. X      case 'v':
  1291. X        fprintf (stderr, CP[102], version, patchlevel);
  1292. X!       exit (1);
  1293. X      default:
  1294. X!       fprintf (stderr, CP[113]);
  1295. X!       exit (1);
  1296. X      }
  1297. X        argv++;
  1298. X        argc--;
  1299. X***************
  1300. X*** 267,273 ****
  1301. X    XC = 0;
  1302. X    Level = 0;
  1303. X  #if defined CHESSTOOL || defined XBOARD
  1304. X!   signal (SIGTERM, ExitChess);
  1305. X    TCflag = true;
  1306. X    TCmoves = 40;
  1307. X    TCminutes = 120;
  1308. X--- 277,283 ----
  1309. X    XC = 0;
  1310. X    Level = 0;
  1311. X  #if defined CHESSTOOL || defined XBOARD
  1312. X!   signal (SIGTERM, TerminateChess);
  1313. X    TCflag = true;
  1314. X    TCmoves = 40;
  1315. X    TCminutes = 120;
  1316. X***************
  1317. X*** 302,308 ****
  1318. X        if (argc > 9)
  1319. X      {
  1320. X        printf ("%s\n", CP[220]);
  1321. X!       exit ();
  1322. X      }
  1323. X        TCmoves = atoi (argv[1]);
  1324. X        TCminutes = strtol (argv[2], &p, 10);
  1325. X--- 312,318 ----
  1326. X        if (argc > 9)
  1327. X      {
  1328. X        printf ("%s\n", CP[220]);
  1329. X!       exit (1);
  1330. X      }
  1331. X        TCmoves = atoi (argv[1]);
  1332. X        TCminutes = strtol (argv[2], &p, 10);
  1333. X***************
  1334. X*** 326,332 ****
  1335. X        else
  1336. X          {
  1337. X            printf (CP[220]);
  1338. X!           exit ();
  1339. X          }
  1340. X        argc -= 2;
  1341. X        argv += 2;
  1342. X--- 336,342 ----
  1343. X        else
  1344. X          {
  1345. X            printf (CP[220]);
  1346. X!           exit (1);
  1347. X          }
  1348. X        argc -= 2;
  1349. X        argv += 2;
  1350. X***************
  1351. X*** 334,340 ****
  1352. X        if (argc)
  1353. X      {
  1354. X        printf ("%s\n", CP[220]);
  1355. X!       exit ();
  1356. X      }
  1357. X      }
  1358. X    Initialize ();
  1359. X--- 344,350 ----
  1360. X        if (argc)
  1361. X      {
  1362. X        printf ("%s\n", CP[220]);
  1363. X!       exit (1);
  1364. X      }
  1365. X      }
  1366. X    Initialize ();
  1367. Xdiff -c ../../../../gnuchess4/src/nondsp.c src/nondsp.c
  1368. X*** ../../../../gnuchess4/src/nondsp.c    Sat May 30 19:39:19 1992
  1369. X--- src/nondsp.c    Thu Jun 18 20:56:46 1992
  1370. X***************
  1371. X*** 301,321 ****
  1372. X    for (i = 1; bstline[i] > 0; i++)
  1373. X      {
  1374. X        if ((i > 1) && (i % 8 == 1))
  1375. X!     fprintf (stderr, "\n                          ");
  1376. X        algbr ((short) (bstline[i] >> 8), (short) (bstline[i] & 0xFF), false);
  1377. X!       fprintf (stderr, "%5s ", mvstr[0]);
  1378. X      }
  1379. X!   fprintf (stderr, "\n");
  1380. X  }
  1381. X  
  1382. X  void
  1383. X  ShowResults (short int score, short unsigned int *bstline, char ch)
  1384. X  {
  1385. X! #if !defined CHESSTOOL && !defined XBOARD
  1386. X    if (flag.post)
  1387. X      {
  1388. X        ElapsedTime (2);
  1389. X!       fprintf (stderr, "%2d%c %6d %4ld %8ld  ", Sdepth, ch, score, et / 100, NodeCnt);
  1390. X        ShowLine (bstline);
  1391. X      }
  1392. X  #else
  1393. X--- 301,321 ----
  1394. X    for (i = 1; bstline[i] > 0; i++)
  1395. X      {
  1396. X        if ((i > 1) && (i % 8 == 1))
  1397. X!     printf ("\n                          ");
  1398. X        algbr ((short) (bstline[i] >> 8), (short) (bstline[i] & 0xFF), false);
  1399. X!       printf ("%5s ", mvstr[0]);
  1400. X      }
  1401. X!   printf ("\n");
  1402. X  }
  1403. X  
  1404. X  void
  1405. X  ShowResults (short int score, short unsigned int *bstline, char ch)
  1406. X  {
  1407. X! #if !defined CHESSTOOL
  1408. X    if (flag.post)
  1409. X      {
  1410. X        ElapsedTime (2);
  1411. X!       printf ("%2d%c %6d %4ld %8ld  ", Sdepth, ch, score, et / 100, NodeCnt);
  1412. X        ShowLine (bstline);
  1413. X      }
  1414. X  #else
  1415. X***************
  1416. X*** 337,346 ****
  1417. X  #ifndef MSDOS
  1418. X    signal (SIGQUIT, TerminateSearch);
  1419. X  #endif /* MSDOS */
  1420. X! #if !defined CHESSTOOL && !defined XBOARD
  1421. X    if (flag.post)
  1422. X      {
  1423. X!       fprintf (stderr, CP[123],
  1424. X             TCmoves - TimeControl.moves[side] + 1,
  1425. X             ResponseTime, TimeControl.clock[side]);
  1426. X      }
  1427. X--- 337,346 ----
  1428. X  #ifndef MSDOS
  1429. X    signal (SIGQUIT, TerminateSearch);
  1430. X  #endif /* MSDOS */
  1431. X! #if !defined CHESSTOOL
  1432. X    if (flag.post)
  1433. X      {
  1434. X!       printf (CP[123],
  1435. X             TCmoves - TimeControl.moves[side] + 1,
  1436. X             ResponseTime, TimeControl.clock[side]);
  1437. X      }
  1438. X***************
  1439. X*** 417,423 ****
  1440. X  nomove:
  1441. X    if ((rootnode.flags & draw)||(rootnode.score == -9999)||
  1442. X        (rootnode.score == 9998)) goto summary;
  1443. X! #if !defined CHESSTOOL && !defined XBOARD
  1444. X    if (flag.post)
  1445. X      {
  1446. X        short h, l, t;
  1447. X--- 417,423 ----
  1448. X  nomove:
  1449. X    if ((rootnode.flags & draw)||(rootnode.score == -9999)||
  1450. X        (rootnode.score == 9998)) goto summary;
  1451. X! #if !defined CHESSTOOL
  1452. X    if (flag.post)
  1453. X      {
  1454. X        short h, l, t;
  1455. X***************
  1456. X*** 433,466 ****
  1457. X          h = t;
  1458. X        t = (l + h) >> 1;
  1459. X      }
  1460. X!       /*fprintf (stderr, "Nodes %ld Tree %d Eval %ld Rate %ld RS high %ld low %ld\n",*/
  1461. X!       fprintf (stderr, CP[89],
  1462. X             NodeCnt, t, EvalNodes, (et) ? (NodeCnt / (et / 100)) : 0, reminus, replus);
  1463. X!       /*fprintf (stderr, "Hin/Hout/Coll/Fin/Fout = %ld/%ld/%ld/%ld/%ld\n",*/
  1464. X!       fprintf (stderr, CP[71],
  1465. X             HashAdd, HashCnt, THashCol, HashCol, FHashAdd, FHashCnt);
  1466. X      }
  1467. X    UpdateDisplay (rootnode.f, rootnode.t, 0, rootnode.flags);
  1468. X!   /*fprintf (stderr, "My move is: %s\n", mvstr[0]);*/
  1469. X!   fprintf (stderr, CP[83], mvstr[0]);
  1470. X    if (flag.beep)
  1471. X      printz ("%c", 7);
  1472. X  #endif /* CHESSTOOL */
  1473. X   summary:
  1474. X    if (rootnode.flags & draw)
  1475. X!     /*    fprintf (stderr, "Drawn game!\n");*/
  1476. X!     fprintf (stderr, CP[57]);
  1477. X    else if (rootnode.score == -9999)
  1478. X!     fprintf(stderr,"%s mates!\n",ColorStr[opponent]);
  1479. X    else if (rootnode.score == 9998)
  1480. X!     fprintf(stderr,"%s mates!\n",ColorStr[computer]);
  1481. X  #if !defined CHESSTOOL && !defined XBOARD
  1482. X  #ifdef VERYBUGGY
  1483. X    else if (rootnode.score < -9000)
  1484. X!     fprintf(stderr,"%s has a forced mate!\n",ColorStr[opponent]);
  1485. X    else if (rootnode.score > 9000)
  1486. X!     fprintf(stderr,"%s has a forced mate!\n",ColorStr[computer]);
  1487. X! #endif VERYBUGGY
  1488. X  #endif /* CHESSTOOL */
  1489. X  }
  1490. X  
  1491. X--- 433,466 ----
  1492. X          h = t;
  1493. X        t = (l + h) >> 1;
  1494. X      }
  1495. X!       /*printf ("Nodes %ld Tree %d Eval %ld Rate %ld RS high %ld low %ld\n",*/
  1496. X!       printf (CP[89],
  1497. X             NodeCnt, t, EvalNodes, (et) ? (NodeCnt / (et / 100)) : 0, reminus, replus);
  1498. X!       /*printf ("Hin/Hout/Coll/Fin/Fout = %ld/%ld/%ld/%ld/%ld\n",*/
  1499. X!       printf (CP[71],
  1500. X             HashAdd, HashCnt, THashCol, HashCol, FHashAdd, FHashCnt);
  1501. X      }
  1502. X    UpdateDisplay (rootnode.f, rootnode.t, 0, rootnode.flags);
  1503. X!   /*printf ("My move is: %s\n", mvstr[0]);*/
  1504. X!   printf (CP[83], mvstr[0]);
  1505. X    if (flag.beep)
  1506. X      printz ("%c", 7);
  1507. X  #endif /* CHESSTOOL */
  1508. X   summary:
  1509. X    if (rootnode.flags & draw)
  1510. X!     /*    printf ("Drawn game!\n");*/
  1511. X!     printf (CP[57]);
  1512. X    else if (rootnode.score == -9999)
  1513. X!     printf("%s mates!\n",ColorStr[opponent]);
  1514. X    else if (rootnode.score == 9998)
  1515. X!     printf("%s mates!\n",ColorStr[computer]);
  1516. X  #if !defined CHESSTOOL && !defined XBOARD
  1517. X  #ifdef VERYBUGGY
  1518. X    else if (rootnode.score < -9000)
  1519. X!     printf("%s has a forced mate!\n",ColorStr[opponent]);
  1520. X    else if (rootnode.score > 9000)
  1521. X!     printf("%s has a forced mate!\n",ColorStr[computer]);
  1522. X! #endif /*VERYBUGGY*/
  1523. X  #endif /* CHESSTOOL */
  1524. X  }
  1525. X  
  1526. X***************
  1527. X*** 524,530 ****
  1528. X  void
  1529. X  ShowMessage (char *s)
  1530. X  {
  1531. X!   fprintf (stderr, "%s\n", s);
  1532. X  }
  1533. X  
  1534. X  void
  1535. X--- 524,530 ----
  1536. X  void
  1537. X  ShowMessage (char *s)
  1538. X  {
  1539. X!   printf("%s\n", s);
  1540. X  }
  1541. X  
  1542. X  void
  1543. X***************
  1544. X*** 576,582 ****
  1545. X    if (hint)
  1546. X      {
  1547. X        algbr ((short) (hint >> 8), (short) (hint & 0xFF), false);
  1548. X!       fprintf (stderr, CP[72], mvstr[0]);    /*hint*/
  1549. X      }
  1550. X    else
  1551. X      printz (CP[223]);
  1552. X--- 576,582 ----
  1553. X    if (hint)
  1554. X      {
  1555. X        algbr ((short) (hint >> 8), (short) (hint & 0xFF), false);
  1556. X!       printf(CP[72], mvstr[0]);    /*hint*/
  1557. X      }
  1558. X    else
  1559. X      printz (CP[223]);
  1560. Xdiff -c ../../../../gnuchess4/src/nuxdsp.c src/nuxdsp.c
  1561. X*** ../../../../gnuchess4/src/nuxdsp.c    Sat May 30 19:37:25 1992
  1562. X--- src/nuxdsp.c    Tue Jun 16 01:42:06 1992
  1563. X***************
  1564. X*** 40,58 ****
  1565. X  #include <sys/types.h>
  1566. X  #include <sys/file.h>
  1567. X  #include <curses.h>
  1568. X  
  1569. X  /* <stdlib.h> */
  1570. X! extern void *malloc (size_t);
  1571. X! extern void exit (int);
  1572. X! extern short int sscore[];
  1573. X  
  1574. X  /* <string.h> */
  1575. X! extern char *strcat (char *, const char *);
  1576. X! extern int strcmp (const char *, const char *);
  1577. X! extern char *strcpy (char *, const char *);
  1578. X  
  1579. X  /* <time.h> */
  1580. X! extern long int time (long int *);
  1581. X  
  1582. X  #endif /* MSDOS */
  1583. X  
  1584. X--- 40,60 ----
  1585. X  #include <sys/types.h>
  1586. X  #include <sys/file.h>
  1587. X  #include <curses.h>
  1588. X+      extern short int sscore[];
  1589. X  
  1590. X+ #if defined(__STDC__)
  1591. X  /* <stdlib.h> */
  1592. X!      extern void *malloc (size_t);
  1593. X!      extern void exit (int);
  1594. X  
  1595. X  /* <string.h> */
  1596. X!      extern char *strcat (char *, const char *);
  1597. X!      extern int strcmp (const char *, const char *);
  1598. X!      extern char *strcpy (char *, const char *);
  1599. X  
  1600. X  /* <time.h> */
  1601. X!      extern long int time (long int *);
  1602. X! #endif
  1603. X  
  1604. X  #endif /* MSDOS */
  1605. X  
  1606. X***************
  1607. X*** 82,88 ****
  1608. X  unsigned short int MV[MAXDEPTH];
  1609. X  int MSCORE;
  1610. X  char *DRAW;
  1611. X! char mvstr[4][6];
  1612. X  short PositionFlag = 0;
  1613. X  
  1614. X  #if defined(MSDOS) && !defined(SEVENBIT)
  1615. X--- 84,91 ----
  1616. X  unsigned short int MV[MAXDEPTH];
  1617. X  int MSCORE;
  1618. X  char *DRAW;
  1619. X! extern char mvstr[4][6];
  1620. X! extern short Mwpawn[64], Mbpawn[64], Mknight[2][64], Mbishop[2][64];
  1621. X  short PositionFlag = 0;
  1622. X  
  1623. X  #if defined(MSDOS) && !defined(SEVENBIT)
  1624. X***************
  1625. X*** 113,118 ****
  1626. X--- 116,122 ----
  1627. X    ListGame ();
  1628. X    gotoXY (1, 24);
  1629. X  #ifndef MSDOS
  1630. X+   refresh();
  1631. X    nocrmode ();
  1632. X    endwin ();
  1633. X  #endif /* MSDOS */
  1634. X***************
  1635. X*** 319,325 ****
  1636. X  ShowScore (short score)
  1637. X  {
  1638. X    gotoXY (TAB, 5);
  1639. X!   printz (CP[104], score);
  1640. X    ClrEoln ();
  1641. X  }
  1642. X  
  1643. X--- 323,329 ----
  1644. X  ShowScore (short score)
  1645. X  {
  1646. X    gotoXY (TAB, 5);
  1647. X!  printz (CP[104], score);
  1648. X    ClrEoln ();
  1649. X  }
  1650. X  
  1651. X***************
  1652. X*** 452,458 ****
  1653. X      printz (CP[96]);
  1654. X    else if (rootnode.score > 9000)
  1655. X      printz (CP[45]);
  1656. X! #endif VERYBUGGY
  1657. X    ClrEoln ();
  1658. X  
  1659. X    if (flag.post)
  1660. X--- 456,462 ----
  1661. X      printz (CP[96]);
  1662. X    else if (rootnode.score > 9000)
  1663. X      printz (CP[45]);
  1664. X! #endif /*VERYBUGGY*/
  1665. X    ClrEoln ();
  1666. X  
  1667. X    if (flag.post)
  1668. X***************
  1669. X*** 778,785 ****
  1670. X      ShowPostnValue (sq);
  1671. X    score = ScorePosition (opponent);
  1672. X    gotoXY (TAB, 5);
  1673. X!   printz (CP[103], score, mtl[computer], pmtl[computer], pscore[computer], sscore[computer],
  1674. X!       mtl[opponent], pmtl[opponent], pscore[opponent], sscore[opponent]);
  1675. X    ClrEoln ();
  1676. X  }
  1677. X  
  1678. X--- 782,788 ----
  1679. X      ShowPostnValue (sq);
  1680. X    score = ScorePosition (opponent);
  1681. X    gotoXY (TAB, 5);
  1682. X!  printz (CP[103], score, mtl[computer], pscore[computer], mtl[opponent],pscore[opponent]);
  1683. X    ClrEoln ();
  1684. X  }
  1685. X  
  1686. X***************
  1687. X*** 826,832 ****
  1688. X    refresh ();
  1689. X  }
  1690. X  
  1691. X! char *InPtr;
  1692. X  void
  1693. X  skip ()
  1694. X  {
  1695. X--- 829,835 ----
  1696. X    refresh ();
  1697. X  }
  1698. X  
  1699. X! extern char *InPtr;
  1700. X  void
  1701. X  skip ()
  1702. X  {
  1703. X***************
  1704. X*** 1009,1021 ****
  1705. X    ShowMessage (CP[65]);
  1706. X    scanz ("%s", s);
  1707. X    c = neutral;
  1708. X!   if (s[0] == CP[9][0] || s[0] == CP[9][1])    /* w W*/
  1709. X!     c = white;
  1710. X!   if (s[0] == CP[9][2] || s[0] == CP[9][3])    /*b B*/
  1711. X!     c = black;
  1712. X    for (p = king; p > no_piece; p--)
  1713. X!     if ((s[1] == pxx[p]) || (s[1] == qxx[p]))
  1714. X!       break;
  1715. X    for (sq = 0; sq < 64; sq++)
  1716. X      {
  1717. X        tp = board[sq];
  1718. X--- 1012,1022 ----
  1719. X    ShowMessage (CP[65]);
  1720. X    scanz ("%s", s);
  1721. X    c = neutral;
  1722. X!   if (s[0] == CP[9][0] || s[0] == CP[9][1])    /* w W*/ c = white;
  1723. X!   if (s[0] == CP[9][2] || s[0] == CP[9][3])    /*b B*/ c = black;
  1724. X    for (p = king; p > no_piece; p--)
  1725. X!     if ((s[1] == pxx[p]) || (s[1] == qxx[p])) break;
  1726. X!   if(p > no_piece)
  1727. X    for (sq = 0; sq < 64; sq++)
  1728. X      {
  1729. X        tp = board[sq];
  1730. X***************
  1731. X*** 1031,1037 ****
  1732. X      }
  1733. X    score = ScorePosition (opponent);
  1734. X    gotoXY (TAB, 5);
  1735. X!   printz (CP[103], score, mtl[computer], pmtl[computer], pscore[computer], sscore[computer],
  1736. X!       mtl[opponent], pmtl[opponent], pscore[opponent], sscore[opponent]);
  1737. X    ClrEoln ();
  1738. X  }
  1739. X--- 1032,1055 ----
  1740. X      }
  1741. X    score = ScorePosition (opponent);
  1742. X    gotoXY (TAB, 5);
  1743. X!   printz (CP[103], score, mtl[computer], pscore[computer], mtl[opponent],pscore[opponent]);
  1744. X    ClrEoln ();
  1745. X  }
  1746. X+ void
  1747. X+ DoTable (short table[64])
  1748. X+ {
  1749. X+   short  sq;
  1750. X+   ExaminePosition ();
  1751. X+   for (sq=0;sq<64;sq++){
  1752. X+ 
  1753. X+   gotoXY (VcoordR (sq, 2, 1));
  1754. X+ #if !defined(MSDOS) || defined(SEVENBIT)
  1755. X+   if (Vblack (sq) && !flag.shade)
  1756. X+     OReverse ();
  1757. X+ #endif /* !MSDOS || SEVENBIT */
  1758. X+ 
  1759. X+     printz ("%3d", table[sq]);
  1760. X+   ONormal ();
  1761. X+ }
  1762. X+ }
  1763. X+ 
  1764. Xdiff -c ../../../../gnuchess4/src/search.c src/search.c
  1765. X*** ../../../../gnuchess4/src/search.c    Sat May 30 19:11:56 1992
  1766. X--- src/search.c    Thu Jun 18 07:20:18 1992
  1767. X***************
  1768. X*** 31,36 ****
  1769. X--- 31,39 ----
  1770. X  unsigned short DBLINE[MAXDEPTH];
  1771. X  struct leaf *dbptr;
  1772. X  #endif
  1773. X+ #ifdef DEBUG40
  1774. X+ int d1h;
  1775. X+ #endif
  1776. X  struct leaf rootnode;
  1777. X  short int restype;
  1778. X  #include "ataks.h"
  1779. X***************
  1780. X*** 139,144 ****
  1781. X--- 142,148 ----
  1782. X    int Jscore;
  1783. X    unsigned short tmp[MAXDEPTH];
  1784. X    flag.timeout = false;
  1785. X+   flag.musttimeout = false;
  1786. X    xside = side ^ 1;
  1787. X    /* if background mode set to infinite */
  1788. X    if (iop == 2)
  1789. X***************
  1790. X*** 202,210 ****
  1791. X    if (!background)
  1792. X  #endif /* QUIETBACKGROUND */
  1793. X      SearchStartStuff (side);
  1794. X! #if !defined NOHISTORY
  1795. X  #ifdef NOMEMSET
  1796. X!   for (i = 0; i < 8192; i++)
  1797. X      history[i] = 0;
  1798. X  #else
  1799. X    memset ((char *) history, 0, sizeof (history));
  1800. X--- 206,214 ----
  1801. X    if (!background)
  1802. X  #endif /* QUIETBACKGROUND */
  1803. X      SearchStartStuff (side);
  1804. X! #ifdef HISTORY
  1805. X  #ifdef NOMEMSET
  1806. X!   for (i = 0; i < 32768; i++)
  1807. X      history[i] = 0;
  1808. X  #else
  1809. X    memset ((char *) history, 0, sizeof (history));
  1810. X***************
  1811. X*** 257,263 ****
  1812. X        Sdepth++;
  1813. X        DepthBeyond = Sdepth + ((Sdepth == 1) ? (DEPTHBEYOND >> 1) : DEPTHBEYOND);
  1814. X  
  1815. X! #if !defined CHESSTOOL && !defined XBOARD
  1816. X  #ifdef QUIETBACKGROUND
  1817. X        if (!background)
  1818. X  #endif /* QUIETBACKGROUND */
  1819. X--- 261,267 ----
  1820. X        Sdepth++;
  1821. X        DepthBeyond = Sdepth + ((Sdepth == 1) ? (DEPTHBEYOND >> 1) : DEPTHBEYOND);
  1822. X  
  1823. X! #if !defined CHESSTOOL
  1824. X  #ifdef QUIETBACKGROUND
  1825. X        if (!background)
  1826. X  #endif /* QUIETBACKGROUND */
  1827. X***************
  1828. X*** 301,306 ****
  1829. X--- 305,313 ----
  1830. X        score = search (side, 1, Sdepth, score, 9999, PrVar, &rpt);
  1831. X      }
  1832. X  /**************** out of search ********************************************/
  1833. X+ #ifdef DEBUG40
  1834. X+       d1h = flag.timeout;
  1835. X+ #endif
  1836. X        if (Sdepth == MaxSearchDepth)
  1837. X      flag.timeout = true;
  1838. X  
  1839. X***************
  1840. X*** 318,323 ****
  1841. X--- 325,331 ----
  1842. X            ExtraTime += TCleft;
  1843. X          }
  1844. X      }
  1845. X+       if(TCflag) if ((4 * et) > (2 * ResponseTime + ExtraTime)) flag.timeout = true;
  1846. X  /************************ time control ***********************************/
  1847. X  
  1848. X        /* save PV as killer */
  1849. X***************
  1850. X*** 380,386 ****
  1851. X        /* recompute search window */
  1852. X        beta = score + ((computer == black) ? BBwindow : WBwindow);
  1853. X  #if !defined NODYNALPHA
  1854. X!       alpha = ((Jscore < score) ? Jscore : score) - ((computer == black) ? BAwindow : WAwindow) + abs (Jscore / 12);
  1855. X  #else
  1856. X        alpha = score - ((computer == black) ? BAwindow : WAwindow);
  1857. X  #endif
  1858. X--- 388,394 ----
  1859. X        /* recompute search window */
  1860. X        beta = score + ((computer == black) ? BBwindow : WBwindow);
  1861. X  #if !defined NODYNALPHA
  1862. X!       alpha = ((Jscore < score) ? Jscore : score) - ((computer == black) ? BAwindow : WAwindow) - abs (Jscore / 12) - 20;
  1863. X  #else
  1864. X        alpha = score - ((computer == black) ? BAwindow : WAwindow);
  1865. X  #endif
  1866. X***************
  1867. X*** 503,510 ****
  1868. X    g->flags = root->flags;
  1869. X  #ifdef DEBUG40
  1870. X    g->d1 = TCcount;
  1871. X!   g->d2 = ResponseTime ;
  1872. X!   g->d4 = TCleft;
  1873. X    g->d3 = ExtraTime;
  1874. X  #endif
  1875. X    /* update time comtrol info */
  1876. X--- 511,518 ----
  1877. X    g->flags = root->flags;
  1878. X  #ifdef DEBUG40
  1879. X    g->d1 = TCcount;
  1880. X!   g->d2 = ResponseTime + ExtraTime;
  1881. X!   g->d4 = d1h;
  1882. X    g->d3 = ExtraTime;
  1883. X  #endif
  1884. X    /* update time comtrol info */
  1885. X***************
  1886. X*** 584,590 ****
  1887. X            flag.musttimeout = false;
  1888. X          }
  1889. X        else if ((et >= (ResponseTime + ExtraTime)) && Sdepth > MINDEPTH)
  1890. X!         flag.timeout = true;
  1891. X      }
  1892. X  
  1893. X      }
  1894. X--- 592,602 ----
  1895. X            flag.musttimeout = false;
  1896. X          }
  1897. X        else if ((et >= (ResponseTime + ExtraTime)) && Sdepth > MINDEPTH)
  1898. X!                {/* try to extend to finish ply */
  1899. X!                 if (TCflag && TCcount < MAXTCCOUNT)
  1900. X!                          { TCcount += 1; ExtraTime += (100); }
  1901. X!                 else flag.timeout = true;
  1902. X!                }
  1903. X      }
  1904. X  
  1905. X      }
  1906. X***************
  1907. X*** 795,801 ****
  1908. X        nxtline[ply + 1] = 0;
  1909. X        if (cf && score + node->score < alpha)
  1910. X      break;
  1911. X! #if !defined CHESSTOOL && !defined XBOARD
  1912. X        /* if at top level */
  1913. X        if (ply == 1)
  1914. X      {            /* at the top update search status */
  1915. X--- 807,813 ----
  1916. X        nxtline[ply + 1] = 0;
  1917. X        if (cf && score + node->score < alpha)
  1918. X      break;
  1919. X! #if !defined CHESSTOOL
  1920. X        /* if at top level */
  1921. X        if (ply == 1)
  1922. X      {            /* at the top update search status */
  1923. X***************
  1924. X*** 872,878 ****
  1925. X            Tree[0] = tmp;
  1926. X            pbst = 0;
  1927. X          }
  1928. X! #if !defined CHESSTOOL && !defined XBOARD
  1929. X  #ifdef QUIETBACKGROUND
  1930. X            if (!background)
  1931. X  #endif /* QUIETBACKGROUND */
  1932. X--- 884,890 ----
  1933. X            Tree[0] = tmp;
  1934. X            pbst = 0;
  1935. X          }
  1936. X! #if !defined CHESSTOOL
  1937. X  #ifdef QUIETBACKGROUND
  1938. X            if (!background)
  1939. X  #endif /* QUIETBACKGROUND */
  1940. X***************
  1941. X*** 925,934 ****
  1942. X  #endif /* ttblsz */
  1943. X    if (depth > 0)
  1944. X      {
  1945. X! #if !defined NOHISTORY
  1946. X        j = (node->f << 6) | node->t;
  1947. X        if (side == black)
  1948. X!     j |= 0x1000;
  1949. X        if (history[j] < 150)
  1950. X      history[j] += (unsigned char) depth << 1;
  1951. X  #endif
  1952. X--- 937,946 ----
  1953. X  #endif /* ttblsz */
  1954. X    if (depth > 0)
  1955. X      {
  1956. X! #ifdef HISTORY
  1957. X        j = (node->f << 6) | node->t;
  1958. X        if (side == black)
  1959. X!     j |= 0x4000;
  1960. X        if (history[j] < 150)
  1961. X      history[j] += (unsigned char) depth << 1;
  1962. X  #endif
  1963. Xdiff -c ../../../../gnuchess4/src/uxdsp.c src/uxdsp.c
  1964. X*** ../../../../gnuchess4/src/uxdsp.c    Sun May 31 08:31:10 1992
  1965. X--- src/uxdsp.c    Tue Jun 16 01:42:55 1992
  1966. X***************
  1967. X*** 41,58 ****
  1968. X  #include <sys/file.h>
  1969. X  #include <curses.h>
  1970. X  
  1971. X! 
  1972. X  /* <stdlib.h> */
  1973. X! extern void *malloc (size_t);
  1974. X! extern void exit (int);
  1975. X  
  1976. X  /* <string.h> */
  1977. X! extern char *strcat (char *, const char *);
  1978. X! extern int strcmp (const char *, const char *);
  1979. X! extern char *strcpy (char *, const char *);
  1980. X  
  1981. X  /* <time.h> */
  1982. X! extern long int time (long int *);
  1983. X  
  1984. X  #endif /* MSDOS */
  1985. X  
  1986. X--- 41,59 ----
  1987. X  #include <sys/file.h>
  1988. X  #include <curses.h>
  1989. X  
  1990. X! #if defined(__STDC__)
  1991. X  /* <stdlib.h> */
  1992. X!      extern void *malloc (size_t);
  1993. X!      extern void exit (int);
  1994. X  
  1995. X  /* <string.h> */
  1996. X!      extern char *strcat (char *, const char *);
  1997. X!      extern int strcmp (const char *, const char *);
  1998. X!      extern char *strcpy (char *, const char *);
  1999. X  
  2000. X  /* <time.h> */
  2001. X!      extern long int time (long int *);
  2002. X! #endif
  2003. X  
  2004. X  #endif /* MSDOS */
  2005. X  
  2006. X***************
  2007. X*** 67,73 ****
  2008. X  unsigned short int MV[MAXDEPTH];
  2009. X  int MSCORE;
  2010. X  char *DRAW;
  2011. X! char mvstr[4][6];
  2012. X  
  2013. X  extern char *getenv (const char *);
  2014. X  void TerminateSearch (int), Die (int);
  2015. X--- 68,74 ----
  2016. X  unsigned short int MV[MAXDEPTH];
  2017. X  int MSCORE;
  2018. X  char *DRAW;
  2019. X! extern char mvstr[4][6];
  2020. X  
  2021. X  extern char *getenv (const char *);
  2022. X  void TerminateSearch (int), Die (int);
  2023. X***************
  2024. X*** 91,96 ****
  2025. X--- 92,98 ----
  2026. X    ListGame ();
  2027. X    gotoXY (1, 24);
  2028. X  #ifndef MSDOS
  2029. X+   refresh();
  2030. X    nocrmode ();
  2031. X    endwin ();
  2032. X  #endif /* MSDOS */
  2033. X***************
  2034. X*** 424,430 ****
  2035. X      printz (CP[96]);
  2036. X    else if (rootnode.score > 9000)
  2037. X      printz (CP[45]);
  2038. X! #endif VERYBUGGY
  2039. X    ClrEoln ();
  2040. X    if (flag.post)
  2041. X      {
  2042. X--- 426,432 ----
  2043. X      printz (CP[96]);
  2044. X    else if (rootnode.score > 9000)
  2045. X      printz (CP[45]);
  2046. X! #endif /*VERYBUGGY*/
  2047. X    ClrEoln ();
  2048. X    if (flag.post)
  2049. X      {
  2050. X***************
  2051. X*** 586,592 ****
  2052. X      ShowPostnValue (sq);
  2053. X    score = ScorePosition (opponent);
  2054. X    gotoXY (TAB, 5);
  2055. X!   printz (CP[103], score, mtl[computer], pmtl[computer], pscore[computer], mtl[opponent], pmtl[opponent], pscore[opponent]);
  2056. X    ClrEoln ();
  2057. X  }
  2058. X  
  2059. X--- 588,595 ----
  2060. X      ShowPostnValue (sq);
  2061. X    score = ScorePosition (opponent);
  2062. X    gotoXY (TAB, 5);
  2063. X!   printz (CP[103], score, mtl[computer], pscore[computer], mtl[opponent],pscore[opponent]);
  2064. X! 
  2065. X    ClrEoln ();
  2066. X  }
  2067. X  
  2068. X***************
  2069. X*** 672,678 ****
  2070. X    refresh ();
  2071. X  }
  2072. X  
  2073. X! char *InPtr;
  2074. X  void
  2075. X  skip ()
  2076. X  {
  2077. X--- 675,681 ----
  2078. X    refresh ();
  2079. X  }
  2080. X  
  2081. X! extern char *InPtr;
  2082. X  void
  2083. X  skip ()
  2084. X  {
  2085. X***************
  2086. X*** 870,875 ****
  2087. X      }
  2088. X    score = ScorePosition (opponent);
  2089. X    gotoXY (TAB, 5);
  2090. X!   printz (CP[103], score, mtl[computer], pmtl[computer], pscore[computer], mtl[opponent], pmtl[opponent], pscore[opponent]);
  2091. X    ClrEoln ();
  2092. X  }
  2093. X--- 873,891 ----
  2094. X      }
  2095. X    score = ScorePosition (opponent);
  2096. X    gotoXY (TAB, 5);
  2097. X!   printz (CP[103], score, mtl[computer], pscore[computer], mtl[opponent],pscore[opponent]);
  2098. X! 
  2099. X    ClrEoln ();
  2100. X  }
  2101. X+ void
  2102. X+ DoTable (short table[64])
  2103. X+ {
  2104. X+   short  sq;
  2105. X+   ExaminePosition ();
  2106. X+   for (sq=0;sq<64;sq++){
  2107. X+   gotoXY (4 + 5 * VIR_C (sq), 5 + 2 * (7 - VIR_R (sq)));
  2108. X+   printz ("%3d ", table[sq]);
  2109. X+ 
  2110. X+ }
  2111. X+ }
  2112. X+ 
  2113. Xdiff -c ../../../../gnuchess4/src/version.h src/version.h
  2114. X*** ../../../../gnuchess4/src/version.h    Sun May 31 08:38:24 1992
  2115. X--- src/version.h    Thu Jun 18 07:21:11 1992
  2116. X***************
  2117. X*** 4,7 ****
  2118. X   *
  2119. X   */
  2120. X  char *version = "4.00";
  2121. X! char *patchlevel = "44";
  2122. X--- 4,7 ----
  2123. X   *
  2124. X   */
  2125. X  char *version = "4.00";
  2126. X! char *patchlevel = "50";
  2127. END_OF_FILE
  2128. if test 55335 -ne `wc -c <'patch01.02'`; then
  2129.     echo shar: \"'patch01.02'\" unpacked with wrong size!
  2130. fi
  2131. # end of 'patch01.02'
  2132. fi
  2133. echo shar: End of archive 2 \(of 2\).
  2134. cp /dev/null ark2isdone
  2135. MISSING=""
  2136. for I in 1 2 ; do
  2137.     if test ! -f ark${I}isdone ; then
  2138.     MISSING="${MISSING} ${I}"
  2139.     fi
  2140. done
  2141. if test "${MISSING}" = "" ; then
  2142.     echo You have unpacked both archives.
  2143.     rm -f ark[1-9]isdone
  2144.     cat patch01.01 patch01.02 >patches01
  2145.     rm patch01.01 patch01.02
  2146.     echo Now type \"'patch -p < patches01'\" to apply the patches
  2147. else
  2148.     echo You still need to unpack the following archives:
  2149.     echo "        " ${MISSING}
  2150. fi
  2151. ##  End of shell archive.
  2152. exit 0
  2153.