home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume21 / gnuchess / patch02 / nondsp.patch < prev    next >
Text File  |  1991-08-01  |  6KB  |  243 lines

  1. *** /tmp/DIST/nondsp.c    Mon Jul 29 07:36:12 1991
  2. --- nondsp.c    Wed Jul 24 10:36:20 1991
  3. ***************
  4. *** 53,59 ****
  5.   short int debuglevel = 0;
  6.   FILE *debugfd;
  7.   #endif /*DEBUG*/
  8. ! #ifdef CHESSTOOL
  9.   short int chesstool = 1;
  10.   #else
  11.   short int chesstool = 0;
  12. --- 53,59 ----
  13.   short int debuglevel = 0;
  14.   FILE *debugfd;
  15.   #endif /*DEBUG*/
  16. ! #if defined CHESSTOOL || defined XBOARD
  17.   short int chesstool = 1;
  18.   #else
  19.   short int chesstool = 0;
  20. ***************
  21. *** 70,76 ****
  22.   Initialize (void)
  23.   {
  24.     mycnt1 = mycnt2 = 0;
  25. ! #ifdef CHESSTOOL
  26.     setlinebuf (stdout);
  27.     /* setvbuf(stdout,NULL,_IOLBF,BUFSIZ); */
  28.     printf ("Chess\n");
  29. --- 70,76 ----
  30.   Initialize (void)
  31.   {
  32.     mycnt1 = mycnt2 = 0;
  33. ! #if defined CHESSTOOL || defined XBOARD
  34.     setlinebuf (stdout);
  35.     /* setvbuf(stdout,NULL,_IOLBF,BUFSIZ); */
  36.     printf ("Chess\n");
  37. ***************
  38. *** 220,226 ****
  39. --- 220,230 ----
  40.         if (SqAtakd (PieceList[opponent][0], computer))
  41.       {
  42.         UnmakeMove (opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
  43. + #if defined CHESSTOOL
  44. +       printz ("Illegal move\n");
  45. + #else
  46.         printz ("Illegal move..(you are in check)\n");
  47. + #endif /*CHESSTOOL*/
  48.         return (false);
  49.       }
  50.         else
  51. ***************
  52. *** 246,254 ****
  53.         return (true);
  54.       }
  55.       }
  56. ! #ifdef CHESSTOOL
  57.     printz ("Illegal move (no matching move generated)");
  58.     printz ("%s\n", s);
  59.   #ifdef DEBUG
  60.     if (true)
  61.       {
  62. --- 250,261 ----
  63.         return (true);
  64.       }
  65.       }
  66. ! #if defined CHESSTOOL 
  67. !   printz ("Illegal move\n");
  68. ! #else
  69.     printz ("Illegal move (no matching move generated)");
  70.     printz ("%s\n", s);
  71. + #endif /*CHESSTOOL*/
  72.   #ifdef DEBUG
  73.     if (true)
  74.       {
  75. ***************
  76. *** 280,286 ****
  77.         fprintf (debugfd, "\n");
  78.       }
  79.   #endif /* DEBUG*/
  80. ! #else
  81.     if (cnt > 1)
  82.       ShowMessage ("Ambiguous Move!");
  83.   #endif /*CHESSTOOL*/
  84. --- 287,293 ----
  85.         fprintf (debugfd, "\n");
  86.       }
  87.   #endif /* DEBUG*/
  88. ! #if !defined CHESSTOOL && !defined XBOARD
  89.     if (cnt > 1)
  90.       ShowMessage ("Ambiguous Move!");
  91.   #endif /*CHESSTOOL*/
  92. ***************
  93. *** 477,483 ****
  94.   ShowResults (short int score, short unsigned int *bstline, char ch)
  95.   {
  96.     register int i;
  97. ! #ifndef CHESSTOOL
  98.     if (flag.post)
  99.       {
  100.         fprintf (stderr, "%2d%c %6d %4ld %8ld  ", Sdepth, ch, score, et, NodeCnt);
  101. --- 484,490 ----
  102.   ShowResults (short int score, short unsigned int *bstline, char ch)
  103.   {
  104.     register int i;
  105. ! #if !defined CHESSTOOL && !defined XBOARD
  106.     if (flag.post)
  107.       {
  108.         fprintf (stderr, "%2d%c %6d %4ld %8ld  ", Sdepth, ch, score, et, NodeCnt);
  109. ***************
  110. *** 499,505 ****
  111.   #ifndef MSDOS
  112.     signal (SIGQUIT, TerminateSearch);
  113.   #endif /* MSDOS */
  114. ! #ifndef CHESSTOOL
  115.     if (flag.post)
  116.       {
  117.         fprintf (stderr, "\nMove# %d    Target= %ld    Clock: %ld\n",
  118. --- 506,512 ----
  119.   #ifndef MSDOS
  120.     signal (SIGQUIT, TerminateSearch);
  121.   #endif /* MSDOS */
  122. ! #if !defined CHESSTOOL && !defined XBOARD
  123.     if (flag.post)
  124.       {
  125.         fprintf (stderr, "\nMove# %d    Target= %ld    Clock: %ld\n",
  126. ***************
  127. *** 531,537 ****
  128.         printz ("%s\n", ColorStr[computer]);
  129.         ExitChess ();
  130.       }
  131. ! #ifndef CHESSTOOL
  132.     if (flag.post)
  133.       {
  134.         fprintf (stderr, "Nodes= %ld  Eval= %ld  Rate= %ld  ",
  135. --- 538,544 ----
  136.         printz ("%s\n", ColorStr[computer]);
  137.         ExitChess ();
  138.       }
  139. ! #if !defined CHESSTOOL && !defined XBOARD
  140.     if (flag.post)
  141.       {
  142.         fprintf (stderr, "Nodes= %ld  Eval= %ld  Rate= %ld  ",
  143. ***************
  144. *** 545,553 ****
  145.   #ifdef DEBUG
  146.     fprintf (debugfd, "My move is: %s\n", mvstr[0]);
  147.   #endif /* DEBUG */
  148.     if (flag.beep)
  149.       printz ("%c", 7);
  150.     if (root->flags & draw)
  151.       fprintf (stderr, "Drawn game!\n");
  152.     else if (root->score == -9999)
  153. --- 552,561 ----
  154.   #ifdef DEBUG
  155.     fprintf (debugfd, "My move is: %s\n", mvstr[0]);
  156.   #endif /* DEBUG */
  157. + #if !defined CHESSTOOL
  158.     if (flag.beep)
  159.       printz ("%c", 7);
  160. ! #endif /*CHESSTOOL*/
  161.     if (root->flags & draw)
  162.       fprintf (stderr, "Drawn game!\n");
  163.     else if (root->score == -9999)
  164. ***************
  165. *** 629,635 ****
  166.   void
  167.   ClrScreen (void)
  168.   {
  169. ! #ifndef CHESSTOOL
  170.     printz ("\n");
  171.   #endif
  172.   }
  173. --- 637,643 ----
  174.   void
  175.   ClrScreen (void)
  176.   {
  177. ! #if !defined CHESSTOOL && !defined XBOARD
  178.     printz ("\n");
  179.   #endif
  180.   }
  181. ***************
  182. *** 1065,1071 ****
  183.   void
  184.   PromptForMove (void)
  185.   {
  186. ! #ifndef CHESSTOOL
  187.     printz ("\nYour move is? ");
  188.   #endif /* CHESSTOOL */
  189.   }
  190. --- 1073,1079 ----
  191.   void
  192.   PromptForMove (void)
  193.   {
  194. ! #if !defined CHESSTOOL && !defined XBOARD
  195.     printz ("\nYour move is? ");
  196.   #endif /* CHESSTOOL */
  197.   }
  198. ***************
  199. *** 1230,1241 ****
  200.         player = opponent;
  201.         if (strcmp (s, "bd") == 0)
  202.       {
  203. ! #ifdef CHESSTOOL
  204.         chesstool = 0;
  205.   #endif /*CHESSTOOL*/
  206.         ClrScreen ();
  207.         UpdateDisplay (0, 0, 1, 0);
  208. ! #ifdef CHESSTOOL
  209.         chesstool = 1;
  210.   #endif /*CHESSTOOL*/
  211.       }
  212. --- 1238,1249 ----
  213.         player = opponent;
  214.         if (strcmp (s, "bd") == 0)
  215.       {
  216. ! #if defined CHESSTOOL || defined XBOARD
  217.         chesstool = 0;
  218.   #endif /*CHESSTOOL*/
  219.         ClrScreen ();
  220.         UpdateDisplay (0, 0, 1, 0);
  221. ! #if defined CHESSTOOL || defined XBOARD
  222.         chesstool = 1;
  223.   #endif /*CHESSTOOL*/
  224.       }
  225. ***************
  226. *** 1367,1373 ****
  227.         computer = opponent;
  228.         opponent = otherside[computer];
  229.       }
  230. ! #ifdef CHESSTOOL
  231.     printf ("%d. %s", ++mycnt2, s);
  232.     if (flag.post)
  233.       {
  234. --- 1375,1381 ----
  235.         computer = opponent;
  236.         opponent = otherside[computer];
  237.       }
  238. ! #if defined CHESSTOOL || defined XBOARD
  239.     printf ("%d. %s", ++mycnt2, s);
  240.     if (flag.post)
  241.       {
  242.