home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume11 / reve / patch2b < prev    next >
Encoding:
Internet Message Format  |  1991-01-03  |  48.2 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i098:  reve - an othello game, Patch2b
  5. Message-ID: <6738@tekred.CNA.TEK.COM>
  6. Date: 20 Dec 90 00:36:57 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1431
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Rich Burridge <rburridge@sun.COM>
  12. Posting-number: Volume 11, Issue 98
  13. Archive-name: reve/Patch2b
  14. Patch-To: reve: Volume 11, Issue 52-58
  15. Environment: SunView, XView, X11R4, termcap
  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 3)."
  26. # Contents:  patches02b
  27. # Wrapped by billr@saab on Wed Dec 19 16:32:29 1990
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'patches02b' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'patches02b'\"
  31. else
  32. echo shar: Extracting \"'patches02b'\" \(46204 characters\)
  33. sed "s/^X//" >'patches02b' <<'END_OF_FILE'
  34. X------- main.c -------
  35. X*** /tmp/da02127    Wed Nov 28 11:00:27 1990
  36. X--- main.c    Wed Nov 28 10:40:26 1990
  37. X***************
  38. X*** 27,40 ****
  39. X  #include "patchlevel.h"
  40. X  #ifdef SYSV
  41. X  #include <string.h>
  42. X  #else
  43. X  #include <strings.h>
  44. X- #endif /*SYSV*/
  45. X  #include <sys/time.h>
  46. X  #ifdef X11
  47. X  #include <X11/Xos.h>
  48. X  #endif /*X11*/
  49. X  
  50. X  /* Text values for the cyclic buttons. */
  51. X  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  52. X  char *notes_values[] = { "off", "on", NULL } ;
  53. X--- 27,49 ----
  54. X  #include "patchlevel.h"
  55. X  #ifdef SYSV
  56. X  #include <string.h>
  57. X+ #include <sys/times.h>
  58. X  #else
  59. X  #include <strings.h>
  60. X  #include <sys/time.h>
  61. X+ #endif /*SYSV*/
  62. X+ 
  63. X  #ifdef X11
  64. X  #include <X11/Xos.h>
  65. X  #endif /*X11*/
  66. X  
  67. X+ #ifdef NO_TIMEVAL
  68. X+ struct timeval {
  69. X+   long tv_sec ;         /* Seconds */
  70. X+   long tv_usec ;        /* Microseconds */
  71. X+ } ;
  72. X+ #endif /*NO_TIMEVAL*/
  73. X+ 
  74. X  /* Text values for the cyclic buttons. */
  75. X  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  76. X  char *notes_values[] = { "off", "on", NULL } ;
  77. X***************
  78. X*** 50,55 ****
  79. X--- 59,66 ----
  80. X  int piece_x ;           /* Current X position of moving piece. */
  81. X  int piece_y ;           /* Current Y position of moving piece */
  82. X  
  83. X+ int animation ;         /* If set, show computer move glide and piece drag. */
  84. X+ int best_cmove ;        /* Best computer move so far. */
  85. X  int bfont_height ;      /* Height in pixels for bold font. */
  86. X  int but_inverted ;      /* Value of panel item inverted. */
  87. X  int color ;             /* Current color value. */
  88. X***************
  89. X*** 56,61 ****
  90. X--- 67,75 ----
  91. X  int cur_ch ;            /* Current character pressed. */
  92. X  int curx ;              /* Current mouse X position. */
  93. X  int cury ;              /* Current mouse Y position. */
  94. X+ int do_bestmove ;       /* If set, continuously update computers best move. */
  95. X+ int do_last ;           /* If set, don't show last move. */
  96. X+ int do_number ;         /* If set, the last stone placed is numbered. */
  97. X  int down ;              /* Indicates is a mouse button is down. */
  98. X  int first_move = 0 ;    /* Set if computer plays first move. */
  99. X  int iconic ;            /* Set if window is currently iconic. */
  100. X***************
  101. X*** 68,73 ****
  102. X--- 82,88 ----
  103. X  int ix ;                /* Initial X position of the icon. */
  104. X  int iy ;                /* Initial Y position of the icon. */
  105. X  int last_move ;         /* Last valid computer move. */
  106. X+ int last_outline ;      /* Position of last piece outline whilst dragging. */
  107. X  int level ;             /* Current level of difficulty for computer moves. */
  108. X  int loadgame = 0 ;      /* Set if there is a game file to load. */
  109. X  int lsval = 0 ;         /* Set to 'l' or 's', if loading or saving. */
  110. X***************
  111. X*** 79,86 ****
  112. X  int nfont_height ;      /* Height in pixels for normal font. */
  113. X  int play_computer ;     /* Set if playing against the computer. */
  114. X  int posspec ;           /* Set if -Wp or -g option is present (for X11) */
  115. X  int saveres = 0 ;       /* If set, save computer results to log file. */
  116. X! int show_moves = 0 ;    /* If set, all possible moves are being shown. */
  117. X  int show_notes ;        /* If set, display notes value from play_reve. */
  118. X  int suggestion = -1 ;   /* Positive if a suggested move. */
  119. X  int suggest_x ;         /* X position of suggested move. */
  120. X--- 94,102 ----
  121. X  int nfont_height ;      /* Height in pixels for normal font. */
  122. X  int play_computer ;     /* Set if playing against the computer. */
  123. X  int posspec ;           /* Set if -Wp or -g option is present (for X11) */
  124. X+ int quickgame ;         /* If set, don't flash turning stones. */
  125. X  int saveres = 0 ;       /* If set, save computer results to log file. */
  126. X! int show_moves ;        /* If set, all possible moves are being shown. */
  127. X  int show_notes ;        /* If set, display notes value from play_reve. */
  128. X  int suggestion = -1 ;   /* Positive if a suggested move. */
  129. X  int suggest_x ;         /* X position of suggested move. */
  130. X***************
  131. X*** 134,140 ****
  132. X               BWIDTH, BHEIGHT, "undo",     0, undo },
  133. X  
  134. X  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (1*(BHEIGHT+BGAP)),
  135. X!              BWIDTH, BHEIGHT, "done",     0, done },
  136. X  
  137. X  { P_BUTTON,  -1,                          -1,   /* Not normally active. */
  138. X               BWIDTH, BHEIGHT, "cancel",  0, remove_textfield },
  139. X--- 150,156 ----
  140. X               BWIDTH, BHEIGHT, "undo",     0, undo },
  141. X  
  142. X  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (1*(BHEIGHT+BGAP)),
  143. X!              BWIDTH, BHEIGHT, "iconify",  0, done },
  144. X  
  145. X  { P_BUTTON,  -1,                          -1,   /* Not normally active. */
  146. X               BWIDTH, BHEIGHT, "cancel",  0, remove_textfield },
  147. X***************
  148. X*** 157,169 ****
  149. X  { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
  150. X               0, 0, "Use left mouse button to move", 0, NULL },
  151. X  
  152. X! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
  153. X               0, 0, "",                                   0, NULL },
  154. X  
  155. X! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
  156. X               0, 0, "White:  2, Black:  2",               0, NULL },
  157. X  
  158. X! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
  159. X               0, 0, "",                                   0, NULL },
  160. X  } ;
  161. X  
  162. X--- 173,185 ----
  163. X  { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (4*(BHEIGHT+BGAP)),
  164. X               0, 0, "Use left mouse button to move", 0, NULL },
  165. X  
  166. X! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (5*(BHEIGHT+BGAP)),
  167. X               0, 0, "",                                   0, NULL },
  168. X  
  169. X! { P_MESSAGE, BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (6*(BHEIGHT+BGAP)),
  170. X               0, 0, "White:  2, Black:  2",               0, NULL },
  171. X  
  172. X! { P_MESSAGE, BBORDER + (3*(BWIDTH+BGAP)), BBORDER + (6*(BHEIGHT+BGAP)),
  173. X               0, 0, "",                                   0, NULL },
  174. X  } ;
  175. X  
  176. X***************
  177. X*** 248,258 ****
  178. X        if (argv[0][0] == '-')
  179. X          switch (argv[0][1])
  180. X            {
  181. X!             case 'b' : isblack = 1 ;
  182. X!                        if (*(argv+1) != NULL && argv[1][0] != '-')
  183. X                           {
  184. X!                            INC ;
  185. X!                            black_dpy = *argv ;
  186. X                           }
  187. X                         break ;
  188. X              case 'c' : play_computer = 1 ;    /* Play against the computer. */
  189. X--- 264,281 ----
  190. X        if (argv[0][0] == '-')
  191. X          switch (argv[0][1])
  192. X            {
  193. X!             case 'a' : /* Allow computer glide and piece dragging. */
  194. X!                        if (EQUAL(argv[0], "-animate")) animation = TRUE ;
  195. X!                        break ;
  196. X!             case 'b' : if (EQUAL(argv[0], "-bestmove")) do_bestmove = TRUE ;
  197. X!                        else if (EQUAL(argv[0], "-black"))
  198. X                           {
  199. X!                            isblack = 1 ;
  200. X!                            if (*(argv+1) != NULL && argv[1][0] != '-')
  201. X!                              {
  202. X!                                INC ;
  203. X!                                black_dpy = *argv ;
  204. X!                              }
  205. X                           }
  206. X                         break ;
  207. X              case 'c' : play_computer = 1 ;    /* Play against the computer. */
  208. X***************
  209. X*** 272,297 ****
  210. X                         break ;
  211. X              case 'i' : inv_video = 1 ;       /* Display in inverse video. */
  212. X                         break ;
  213. X!             case 'l' : INC ;                 /* Reve game file to load. */
  214. X!                        getparam(gamefile, argv, "-l needs a game file") ;
  215. X!                        loadgame = 1 ;        /* Game file to load. */
  216. X                         break ;
  217. X              case 'm' : monochrome = 1 ;      /* Force display to mono. */
  218. X                         for (i = 0; i < MAXDPY; i++) iscolor[i] = 0 ;
  219. X                         break ;
  220. X!             case 'n' : show_notes = 1 ;      /* Display computer notes. */
  221. X!                        items[(int) NOTES].value = 1 ;
  222. X                         break ;
  223. X              case 'r' : saveres = 1 ;       /* Save computer results to file. */
  224. X                         break ;
  225. X              case '?' :
  226. X              case 'v' : usage() ;
  227. X  
  228. X!             case 'w' : iswhite = 1 ;
  229. X!                        if (*(argv+1) != NULL && argv[1][0] != '-')
  230. X                           {
  231. X!                            INC ;
  232. X!                            white_dpy = *argv ;
  233. X                           }
  234. X                         break ;
  235. X  
  236. X--- 295,333 ----
  237. X                         break ;
  238. X              case 'i' : inv_video = 1 ;       /* Display in inverse video. */
  239. X                         break ;
  240. X!             case 'l' :      if (EQUAL(argv[0], "-last")) do_last = TRUE ;
  241. X!                        else if (EQUAL(argv[0], "-load"))
  242. X!                          {
  243. X!                            INC ;             /* Reve game file to load. */
  244. X!                            getparam(gamefile, argv, "-l needs a game file") ;
  245. X!                            loadgame = 1 ;        /* Game file to load. */
  246. X!                          }
  247. X                         break ;
  248. X              case 'm' : monochrome = 1 ;      /* Force display to mono. */
  249. X                         for (i = 0; i < MAXDPY; i++) iscolor[i] = 0 ;
  250. X                         break ;
  251. X!             case 'n' : if (EQUAL(argv[0], "-notes"))
  252. X!                          {
  253. X!                            show_notes = TRUE ;
  254. X!                            items[(int) NOTES].value = 1 ;
  255. X!                          }
  256. X!                        else if (EQUAL(argv[0], "-number")) do_number = TRUE ;
  257. X                         break ;
  258. X+             case 'q' : if (EQUAL(argv[0], "-quick")) quickgame = TRUE ;
  259. X+                        break ;
  260. X              case 'r' : saveres = 1 ;       /* Save computer results to file. */
  261. X                         break ;
  262. X              case '?' :
  263. X              case 'v' : usage() ;
  264. X  
  265. X!             case 'w' : if (EQUAL(argv[0], "-white"))
  266. X                           {
  267. X!                            iswhite = 1 ;
  268. X!                            if (*(argv+1) != NULL && argv[1][0] != '-')
  269. X!                              {
  270. X!                                INC ;
  271. X!                                white_dpy = *argv ;
  272. X!                              }
  273. X                           }
  274. X                         break ;
  275. X  
  276. X***************
  277. X*** 417,422 ****
  278. X--- 453,459 ----
  279. X      }
  280. X    batch(IS_OFF) ;
  281. X    show_last(last_move, IS_ON) ;
  282. X+   show_number(last_move, IS_ON) ;
  283. X    show_suggestion() ;
  284. X    batch(IS_ON) ;
  285. X    FOR_BOARD(i)
  286. X***************
  287. X*** 451,460 ****
  288. X--- 488,505 ----
  289. X    play_computer = 1 ;                 /* Default is human vs computer. */
  290. X    iconic        = 0 ;                 /* Initially an open window. */
  291. X    last_move     = -1 ;
  292. X+   last_outline  = -1 ;
  293. X    next_player   = BLACK ;
  294. X+   animation     = FALSE ;
  295. X+   best_cmove    = -1 ;
  296. X    but_inverted  = -1 ;
  297. X+   do_bestmove   = FALSE ;
  298. X+   do_last       = FALSE ;
  299. X+   do_number     = FALSE ;
  300. X+   quickgame     = FALSE ;
  301. X    validkey      = 0 ;
  302. X    cmode         = BLACK_START ;
  303. X+   show_moves    = FALSE ;
  304. X    show_notes    = FALSE ;
  305. X    isblack       = 0 ;
  306. X    iswhite       = 0 ;
  307. X***************
  308. X*** 463,469 ****
  309. X  
  310. X    black_dpy = NULL ;              /* X11 black piece display information. */
  311. X    white_dpy = NULL ;              /* X11 white piece display information. */
  312. X!   STRCPY(geometry,  "") ;         /* X11 geometry information. */
  313. X    STRCPY(edgefile, EDGENAME) ;
  314. X  }
  315. X  
  316. X--- 508,515 ----
  317. X  
  318. X    black_dpy = NULL ;              /* X11 black piece display information. */
  319. X    white_dpy = NULL ;              /* X11 white piece display information. */
  320. X!   STRCPY(geometry[(int) DPY1], "") ;    /* X11 geometry information. */
  321. X!   STRCPY(geometry[(int) DPY2], "") ;
  322. X    STRCPY(edgefile, EDGENAME) ;
  323. X  }
  324. X  
  325. X***************
  326. X*** 590,598 ****
  327. X  {
  328. X    set_cursor(HOURGLASS) ;
  329. X    move = TRUE ;            /* Make sure the computer clock is decremented. */
  330. X    play_reve(board.square, player, level, &move, ¬e) ;
  331. X    set_cursor(CANVASCUR) ;
  332. X!   animate_move(move) ;
  333. X    do_move(player) ;
  334. X    last_move = move ;
  335. X    cmode = (enum cantype) (OPPONENT(player) + 1) ;
  336. X--- 636,648 ----
  337. X  {
  338. X    set_cursor(HOURGLASS) ;
  339. X    move = TRUE ;            /* Make sure the computer clock is decremented. */
  340. X+   best_cmove = -1 ;
  341. X+   message(EVAL_MES, "") ;
  342. X    play_reve(board.square, player, level, &move, ¬e) ;
  343. X    set_cursor(CANVASCUR) ;
  344. X!   if (animation == TRUE) animate_move(move) ;
  345. X!   if (best_cmove != -1 && do_bestmove == TRUE)
  346. X!     draw_square(best_cmove, IS_OFF, 2) ;
  347. X    do_move(player) ;
  348. X    last_move = move ;
  349. X    cmode = (enum cantype) (OPPONENT(player) + 1) ;
  350. X***************
  351. X*** 603,612 ****
  352. X  usage()
  353. X  {
  354. X    FPRINTF(stderr, "%s version 1.1.%1d\n\n", progname, PATCHLEVEL) ;
  355. X!   FPRINTF(stderr, "Usage: %s: [-b [display] ] [-c]\n", progname) ;
  356. X!   FPRINTF(stderr, "\t[-d difficulty] [-e edgefile] [-g geometry]\n") ;
  357. X!   FPRINTF(stderr, "\t[-l gamefile] [-v] [-w [display] ] [-?] [-Wi]\n") ;
  358. X!   FPRINTF(stderr, "\t[-Wp x y] [-WP x y]\n") ;
  359. X  }
  360. X  
  361. X  
  362. X--- 653,663 ----
  363. X  usage()
  364. X  {
  365. X    FPRINTF(stderr, "%s version 1.1.%1d\n\n", progname, PATCHLEVEL) ;
  366. X!   FPRINTF(stderr, "Usage: %s: [-animate] [-bestmove]\n", progname) ;
  367. X!   FPRINTF(stderr, "\t[-black [display] ] [-c] [-d difficulty]\n") ;
  368. X!   FPRINTF(stderr, "\t[-e edgefile] [-g geometry] [-last]\n") ;
  369. X!   FPRINTF(stderr, "\t[-load gamefile] [-number] [-notes] [-v]\n") ;
  370. X!   FPRINTF(stderr, "\t[-w [display] ] [-?] [-Wi] [-Wp x y] [-WP x y]\n") ;
  371. X  }
  372. X  
  373. X  
  374. X***************
  375. X*** 614,624 ****
  376. X--- 665,682 ----
  377. X  usleep(x)        /* Suspend execution for interval in microseconds. */
  378. X  unsigned x ;
  379. X  {
  380. X+ #ifdef NOSELECT
  381. X+   unsigned seconds = x / 1000 ;
  382. X+ 
  383. X+   if (x > 0) sleep(x) ;
  384. X+ #else
  385. X+ 
  386. X    struct timeval st_delay ;
  387. X  
  388. X    st_delay.tv_usec = x ;
  389. X    st_delay.tv_sec = 0 ;
  390. X    (void) select(32, NULL, NULL, NULL, &st_delay) ;
  391. X+ #endif /*NOSELECT*/
  392. X  }    
  393. X  #endif /*NO_USLEEP*/
  394. X  
  395. X
  396. X------- procs.c -------
  397. X*** /tmp/da02133    Wed Nov 28 11:00:29 1990
  398. X--- procs.c    Fri Nov 23 07:12:47 1990
  399. X***************
  400. X*** 41,57 ****
  401. X  {
  402. X    int cx, cy ;
  403. X  
  404. X    set_cursor(CANVASCUR) ;
  405. X    if (state == LEFT_DOWN)
  406. X      {
  407. X!       draw_piece(next_player, piece_x, piece_y, RINV) ;
  408. X        cmode = (enum cantype) ((int) cmode - 1) ;
  409. X      }
  410. X    else
  411. X      {
  412. X!       draw_piece(next_player, piece_x, piece_y, RINV) ;
  413. X!       cx = (piece_x + PIECE_RAD - BBORDER) / CELL_SIZE ;
  414. X!       cy = (piece_y + PIECE_RAD - CY - BBORDER) / CELL_SIZE ;
  415. X        move = cy * BOARD_SIZE + cx ;
  416. X        make_move() ;
  417. X      }
  418. X--- 41,62 ----
  419. X  {
  420. X    int cx, cy ;
  421. X  
  422. X+   cx = (piece_x + PIECE_RAD - BBORDER) / CELL_SIZE ;
  423. X+   cy = (piece_y + PIECE_RAD - CY - BBORDER) / CELL_SIZE ;
  424. X+ 
  425. X    set_cursor(CANVASCUR) ;
  426. X    if (state == LEFT_DOWN)
  427. X      {
  428. X!       draw_outline(cy * BOARD_SIZE + cx, IS_ON) ;
  429. X!       if (animation == TRUE)
  430. X!         draw_piece(next_player, piece_x, piece_y, RINV) ;
  431. X        cmode = (enum cantype) ((int) cmode - 1) ;
  432. X      }
  433. X    else
  434. X      {
  435. X!       if (animation == TRUE)
  436. X!         draw_piece(next_player, piece_x, piece_y, RINV) ;
  437. X!       draw_outline(last_outline, IS_OFF) ;
  438. X        move = cy * BOARD_SIZE + cx ;
  439. X        make_move() ;
  440. X      }
  441. X***************
  442. X*** 171,177 ****
  443. X                         break ;
  444. X        case DECREMENT : if (--item_value == -1)
  445. X                           {
  446. X!                            while (choices[++item_value] != NULL) ;
  447. X                             item_value-- ;
  448. X                             items[(int) item].value = item_value ;
  449. X                           }
  450. X--- 176,182 ----
  451. X                         break ;
  452. X        case DECREMENT : if (--item_value == -1)
  453. X                           {
  454. X!                            while (choices[++item_value] != NULL) continue ;
  455. X                             item_value-- ;
  456. X                             items[(int) item].value = item_value ;
  457. X                           }
  458. X***************
  459. X*** 218,223 ****
  460. X--- 223,229 ----
  461. X              suggest_x+5, CY+suggest_y+5, RSRC, C_BLACK) ;
  462. X    draw_line(suggest_x-5, CY+suggest_y+5,
  463. X              suggest_x+5, CY+suggest_y-5, RSRC, C_BLACK) ;
  464. X+   if (show_notes) set_eval(player, suggestion, note) ;
  465. X  }
  466. X  
  467. X  
  468. X***************
  469. X*** 254,260 ****
  470. X    if (n >= 3)
  471. X      {
  472. X        show_last(last_move, IS_OFF) ;
  473. X!       FOR_BOARD(i) board.square[i] = moves[n].square[i] ;
  474. X        board.moves_left = moves[n].moves_left ;
  475. X        board.player     = moves[n].player ;
  476. X        board.move       = moves[n].move ;
  477. X--- 260,278 ----
  478. X    if (n >= 3)
  479. X      {
  480. X        show_last(last_move, IS_OFF) ;
  481. X!       show_number(last_move, IS_OFF) ;
  482. X!       FOR_BOARD(i)
  483. X!         {
  484. X!           if (moves[n].square[i] != board.square[i])
  485. X!             {
  486. X!               get_xy(i, &x, &y) ;
  487. X!               if (moves[n].square[i] == FREE)
  488. X!                 color_area(x, CY+y, PSIZE, PSIZE,
  489. X!                            (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
  490. X!               else draw_piece(moves[n].square[i], x, CY+y, RSRC) ;
  491. X!             }
  492. X!           board.square[i] = moves[n].square[i] ;
  493. X!         }
  494. X        board.moves_left = moves[n].moves_left ;
  495. X        board.player     = moves[n].player ;
  496. X        board.move       = moves[n].move ;
  497. X***************
  498. X*** 276,290 ****
  499. X        else                           cmode = WHITE_START ;
  500. X        message(PANEL_MES, "") ;
  501. X  
  502. X!       FOR_BOARD(i)
  503. X          {
  504. X!           get_xy(i, &x, &y) ;
  505. X!           if (board.square[i] == FREE)
  506. X!             color_area(x, CY+y, PSIZE, PSIZE,
  507. X!                        (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
  508. X!           else draw_piece(board.square[i], x, CY+y, RSRC) ;
  509. X          }
  510. X!       if (n > 3) show_last(last_move, IS_ON) ;
  511. X        next_player = OPPONENT(board.player) ;
  512. X      }
  513. X    else message(PANEL_MES, "No moves to undo.") ;
  514. X--- 294,306 ----
  515. X        else                           cmode = WHITE_START ;
  516. X        message(PANEL_MES, "") ;
  517. X  
  518. X!       if (n > 3)
  519. X          {
  520. X!           show_last(last_move, IS_ON) ;
  521. X!           show_number(last_move, IS_ON) ;
  522. X!           if (show_notes) set_eval(board.player, board.move, board.note) ;
  523. X          }
  524. X!       else message(EVAL_MES, "") ;
  525. X        next_player = OPPONENT(board.player) ;
  526. X      }
  527. X    else message(PANEL_MES, "No moves to undo.") ;
  528. X
  529. X------- rev_eval.c -------
  530. X*** /tmp/da02136    Wed Nov 28 11:00:29 1990
  531. X--- rev_eval.c    Tue Nov 20 10:31:35 1990
  532. X***************
  533. X*** 36,42 ****
  534. X   *     - Potential Mobility, looking at squares contacts
  535. X   *  And then Eval = c1 * ES + c2 * ( CM + cx * XV ) + c3 * PM
  536. X   *  Eval is replaced by - Eval if Black is replaced by White. Eval is positive
  537. X!  *  if macouleur ( my color ) has a good position and negatif if tacouleur
  538. X   *  position is good.
  539. X   *  If we are "near" the end of the game, then Eval is equal to final disc
  540. X   *  differential.
  541. X--- 36,42 ----
  542. X   *     - Potential Mobility, looking at squares contacts
  543. X   *  And then Eval = c1 * ES + c2 * ( CM + cx * XV ) + c3 * PM
  544. X   *  Eval is replaced by - Eval if Black is replaced by White. Eval is positive
  545. X!  *  if macouleur ( my color ) has a good position and negative if tacouleur
  546. X   *  position is good.
  547. X   *  If we are "near" the end of the game, then Eval is equal to final disc
  548. X   *  differential.
  549. X***************
  550. X*** 83,88 ****
  551. X--- 83,94 ----
  552. X          }
  553. X        note = edges[i] ;
  554. X  
  555. X+       if (((i == 2191) && (d[13] == macouleur)) ||
  556. X+           ((i == 2917) && (d[10] == macouleur)) ||
  557. X+           ((i == 3643) && (d[10] == tacouleur)) ||
  558. X+           ((i == 4369) && (d[13] == tacouleur)))
  559. X+         note -= edges[i] ;
  560. X+ 
  561. X        i = 0 ;
  562. X        for (p = &d[56]; p < &d[64]; p++)
  563. X          {
  564. X***************
  565. X*** 92,97 ****
  566. X--- 98,109 ----
  567. X          }
  568. X        note += edges[i] ;
  569. X  
  570. X+       if (((i == 2191) && (d[53] == macouleur)) ||
  571. X+           ((i == 2917) && (d[50] == macouleur)) ||
  572. X+           ((i == 3643) && (d[50] == tacouleur)) ||
  573. X+           ((i == 4369) && (d[53] == tacouleur)))
  574. X+         note -= edges[i] ;
  575. X+ 
  576. X        i = 0 ;
  577. X        for (p = &d[0]; p < &d[64]; p += 8)
  578. X          {
  579. X***************
  580. X*** 101,106 ****
  581. X--- 113,124 ----
  582. X          }
  583. X        note += edges[i] ;
  584. X  
  585. X+       if (((i == 2191) && (d[41] == macouleur)) ||
  586. X+           ((i == 2917) && (d[17] == macouleur)) ||
  587. X+           ((i == 3643) && (d[17] == tacouleur)) ||
  588. X+           ((i == 4369) && (d[41] == tacouleur)))
  589. X+         note -= edges[i] ;
  590. X+ 
  591. X        i = 0 ;
  592. X        for (p = &d[7]; p < &d[64]; p += 8)
  593. X          {
  594. X***************
  595. X*** 109,114 ****
  596. X--- 127,138 ----
  597. X            else if (*p == macouleur) i += 2 ;
  598. X          }
  599. X        note += edges[i] ;
  600. X+ 
  601. X+       if (((i == 2191) && (d[46] == macouleur)) ||
  602. X+           ((i == 2917) && (d[22] == macouleur)) ||
  603. X+           ((i == 3643) && (d[22] == tacouleur)) ||
  604. X+           ((i == 4369) && (d[46] == tacouleur)))
  605. X+         note -= edges[i] ;
  606. X  
  607. X        cx = 8 * (50 - mnb - profmax) ;
  608. X  
  609. X
  610. X------- rev_ip.c -------
  611. X*** /tmp/da02139    Wed Nov 28 11:00:30 1990
  612. X--- rev_ip.c    Fri Nov 23 23:17:29 1990
  613. X***************
  614. X*** 23,29 ****
  615. X--- 23,34 ----
  616. X  #include <signal.h>
  617. X  #include <setjmp.h>
  618. X  #include <sys/types.h>
  619. X+ #ifdef SYSV
  620. X+ #include <sys/times.h>
  621. X+ #else
  622. X  #include <sys/time.h>
  623. X+ #endif /*SYSV*/
  624. X+ 
  625. X  #include "reve.h"
  626. X  
  627. X  extern int saveres ;
  628. X***************
  629. X*** 166,172 ****
  630. X  
  631. X    if (((k == 1) && (mnb < 52)) || (mnb == 1))
  632. X      {
  633. X!       for (cp = 0; d0[cpk[cp]] != JPJ; cp++) ;
  634. X        cpi[0] = cpi[cp] ;
  635. X        cpj[0] = cpj[cp] ;
  636. X        cpk[0] = cpk[cp] ;
  637. X--- 171,177 ----
  638. X  
  639. X    if (((k == 1) && (mnb < 52)) || (mnb == 1))
  640. X      {
  641. X!       for (cp = 0; d0[cpk[cp]] != JPJ; cp++) continue ;
  642. X        cpi[0] = cpi[cp] ;
  643. X        cpj[0] = cpj[cp] ;
  644. X        cpk[0] = cpk[cp] ;
  645. X***************
  646. X*** 219,229 ****
  647. X        allotime = timeleft * 3 / (61 - mnb) ;
  648. X        firsttime = time((time_t *) NULL) ;
  649. X  
  650. X!       signal(SIGALRM, catcher) ;
  651. X  
  652. X        if (setjmp(jumper) != 0)
  653. X          {
  654. X!           if (cpmax == 0) note = oldnote ;
  655. X            profmax = -profmax ;
  656. X            goto trap ;
  657. X          }
  658. X--- 224,236 ----
  659. X        allotime = timeleft * 3 / (61 - mnb) ;
  660. X        firsttime = time((time_t *) NULL) ;
  661. X  
  662. X!       cpmaxi[0] = cpmaxi[1] = cpmaxi[2] = cpmaxi[3] = 0 ;
  663. X  
  664. X+       SIGNAL(SIGALRM, catcher) ;
  665. X+ 
  666. X        if (setjmp(jumper) != 0)
  667. X          {
  668. X!           if (note == -1000000000) note = oldnote ;
  669. X            profmax = -profmax ;
  670. X            goto trap ;
  671. X          }
  672. X***************
  673. X*** 233,239 ****
  674. X            oldnote = note ;
  675. X            note = -1000000000 ;
  676. X  
  677. X!           if ((int) (allotime - timeused) > 2) alarm(allotime - timeused) ;
  678. X  
  679. X            c1 = 312 + 6 * (mnb + profmax) ;
  680. X            if (mnb + profmax < 25)
  681. X--- 240,247 ----
  682. X            oldnote = note ;
  683. X            note = -1000000000 ;
  684. X  
  685. X!           if ((int) (allotime - timeused) > 2)
  686. X!             ALARM((unsigned) (allotime - timeused)) ;
  687. X  
  688. X            c1 = 312 + 6 * (mnb + profmax) ;
  689. X            if (mnb + profmax < 25)
  690. X***************
  691. X*** 247,254 ****
  692. X            if (profmax > 53 - mnb)
  693. X              {
  694. X                profmax = 61 - mnb ;
  695. X!               allotime = timeleft * 3 / 5 ;
  696. X!               if ((int) (allotime - timeused) > 2) alarm(allotime - timeused) ;
  697. X              }
  698. X  
  699. X            for (cp = 0; cp <= 60 - mnb; cp++)
  700. X--- 255,263 ----
  701. X            if (profmax > 53 - mnb)
  702. X              {
  703. X                profmax = 61 - mnb ;
  704. X!               allotime = timeleft * 2 / 3 ;
  705. X!               if ((int) (allotime - timeused) > 2)
  706. X!                 ALARM((unsigned) (allotime - timeused)) ;
  707. X              }
  708. X  
  709. X            for (cp = 0; cp <= 60 - mnb; cp++)
  710. X***************
  711. X*** 267,283 ****
  712. X                      {
  713. X                        note = lnote ;
  714. X                        cpmax = cp ;
  715. X                      }
  716. X                  }
  717. X              }
  718. X  
  719. X!           alarm(0) ;
  720. X            cpmaxi[0] = cpmax ;
  721. X  
  722. X            if ((mnb < 57) && (cpmaxi[0] != cpmaxi[1])
  723. X                && (cpmaxi[1] != cpmaxi[2]) && (cpmaxi[0] != cpmaxi[2]))
  724. X              {
  725. X-               if (cpmax == 0) count++ ; else count = 1 ;
  726. X                for (cp = 0; cp <= 60 - mnb; cp++) cpf[cp] = TRUE ;
  727. X                for (k = 0; k < 3; k++)
  728. X                  {
  729. X--- 276,294 ----
  730. X                      {
  731. X                        note = lnote ;
  732. X                        cpmax = cp ;
  733. X+                       show_best(cpk[cpmax], lnote) ;
  734. X                      }
  735. X                  }
  736. X              }
  737. X  
  738. X!           ALARM(0) ;
  739. X            cpmaxi[0] = cpmax ;
  740. X+           if (cpmax == 0) count += 2 ;
  741. X+           else            count = 1 ;
  742. X  
  743. X            if ((mnb < 57) && (cpmaxi[0] != cpmaxi[1])
  744. X                && (cpmaxi[1] != cpmaxi[2]) && (cpmaxi[0] != cpmaxi[2]))
  745. X              {
  746. X                for (cp = 0; cp <= 60 - mnb; cp++) cpf[cp] = TRUE ;
  747. X                for (k = 0; k < 3; k++)
  748. X                  {
  749. X***************
  750. X*** 318,324 ****
  751. X            timeused = time((time_t *) NULL) - firsttime ;
  752. X            if ((mnb == 4) && (profmax == 3)) break ;
  753. X          }
  754. X!       while ((timeused * count < allotime * 5 / 4) && (profmax != 61 - mnb)) ;
  755. X  trap:
  756. X        timeused = time((time_t *) NULL) - firsttime ;
  757. X        if (timeused == 0) timeused = 1 ;
  758. X--- 329,335 ----
  759. X            timeused = time((time_t *) NULL) - firsttime ;
  760. X            if ((mnb == 4) && (profmax == 3)) break ;
  761. X          }
  762. X!       while ((timeused * count < allotime * 4 / 5) && (profmax != 61 - mnb)) ;
  763. X  trap:
  764. X        timeused = time((time_t *) NULL) - firsttime ;
  765. X        if (timeused == 0) timeused = 1 ;
  766. X***************
  767. X*** 354,361 ****
  768. X  long alpha, beta ;
  769. X  {
  770. X    register int *d0, *d1 ;
  771. X!   register int k, cp, cpmax ;
  772. X    register long lnote, note ;
  773. X  
  774. X    d0 = damier[niv] ;
  775. X    d1 = damier[niv + 1] ;
  776. X--- 365,373 ----
  777. X  long alpha, beta ;
  778. X  {
  779. X    register int *d0, *d1 ;
  780. X!   register int k, cp ;
  781. X    register long lnote, note ;
  782. X+   register int cpmax = 0 ;
  783. X  
  784. X    d0 = damier[niv] ;
  785. X    d1 = damier[niv + 1] ;
  786. X***************
  787. X*** 402,409 ****
  788. X  long alpha, beta ;
  789. X  {
  790. X    register int *d0, *d1 ;
  791. X!   register int k, cp, cpmax ;
  792. X    register long lnote, note ;
  793. X  
  794. X    d0 = damier[niv] ;
  795. X    d1 = damier[niv + 1] ;
  796. X--- 414,422 ----
  797. X  long alpha, beta ;
  798. X  {
  799. X    register int *d0, *d1 ;
  800. X!   register int k, cp ;
  801. X    register long lnote, note ;
  802. X+   register int cpmax = 0 ;
  803. X  
  804. X    d0 = damier[niv] ;
  805. X    d1 = damier[niv + 1] ;
  806. X
  807. X------- rev_iycp.c -------
  808. X*** /tmp/da02142    Wed Nov 28 11:00:31 1990
  809. X--- rev_iycp.c    Tue Nov 20 10:53:09 1990
  810. X***************
  811. X*** 60,66 ****
  812. X  
  813. X                for (x = posx + 1;
  814. X                     (x < 7) && (d[(x << 3) + posy] == tacouleur);
  815. X!                    x++) ;
  816. X                if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
  817. X                  {
  818. X                    flag = TRUE ;
  819. X--- 60,66 ----
  820. X  
  821. X                for (x = posx + 1;
  822. X                     (x < 7) && (d[(x << 3) + posy] == tacouleur);
  823. X!                    x++) continue ;
  824. X                if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
  825. X                  {
  826. X                    flag = TRUE ;
  827. X***************
  828. X*** 71,77 ****
  829. X  
  830. X                for (x = posx - 1;
  831. X                     (x > 0) && (d[(x << 3) + posy] == tacouleur);
  832. X!                    x--) ;
  833. X                if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
  834. X                  {
  835. X                    flag = TRUE ;
  836. X--- 71,77 ----
  837. X  
  838. X                for (x = posx - 1;
  839. X                     (x > 0) && (d[(x << 3) + posy] == tacouleur);
  840. X!                    x--) continue ;
  841. X                if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
  842. X                  {
  843. X                    flag = TRUE ;
  844. X***************
  845. X*** 82,88 ****
  846. X  
  847. X                for (y = posy + 1;
  848. X                     (y < 7) && (d[pos8x + y] == tacouleur);
  849. X!                    y++) ;
  850. X                if ((y != posy + 1) && (d[pos8x + y] == macouleur))
  851. X                  {
  852. X                    flag = TRUE ;
  853. X--- 82,88 ----
  854. X  
  855. X                for (y = posy + 1;
  856. X                     (y < 7) && (d[pos8x + y] == tacouleur);
  857. X!                    y++) continue ;
  858. X                if ((y != posy + 1) && (d[pos8x + y] == macouleur))
  859. X                  {
  860. X                    flag = TRUE ;
  861. X***************
  862. X*** 93,99 ****
  863. X  
  864. X                for (y = posy - 1;
  865. X                     (y > 0) && (d[pos8x + y] == tacouleur);
  866. X!                    y--) ;
  867. X                if ((y != posy - 1) && (d[pos8x + y] == macouleur))
  868. X                  {
  869. X                    flag = TRUE ;
  870. X--- 93,99 ----
  871. X  
  872. X                for (y = posy - 1;
  873. X                     (y > 0) && (d[pos8x + y] == tacouleur);
  874. X!                    y--) continue ;
  875. X                if ((y != posy - 1) && (d[pos8x + y] == macouleur))
  876. X                  {
  877. X                    flag = TRUE ;
  878. X***************
  879. X*** 104,110 ****
  880. X  
  881. X                for (x = posx + 1,  y = posy + 1; 
  882. X                     (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  883. X!                    x++, y++) ;
  884. X                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  885. X                  {
  886. X                    flag = TRUE ;
  887. X--- 104,110 ----
  888. X  
  889. X                for (x = posx + 1,  y = posy + 1; 
  890. X                     (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  891. X!                    x++, y++) continue ;
  892. X                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  893. X                  {
  894. X                    flag = TRUE ;
  895. X***************
  896. X*** 115,121 ****
  897. X  
  898. X                for (x = posx - 1,  y = posy + 1; 
  899. X                     (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  900. X!                    x--, y++) ;
  901. X                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  902. X                  {
  903. X                    flag = TRUE ;
  904. X--- 115,121 ----
  905. X  
  906. X                for (x = posx - 1,  y = posy + 1; 
  907. X                     (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  908. X!                    x--, y++) continue ;
  909. X                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  910. X                  {
  911. X                    flag = TRUE ;
  912. X***************
  913. X*** 126,132 ****
  914. X  
  915. X                for (x = posx + 1,  y = posy - 1; 
  916. X                     (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  917. X!                    x++, y--) ;
  918. X                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  919. X                  {
  920. X                    flag = TRUE ;
  921. X--- 126,132 ----
  922. X  
  923. X                for (x = posx + 1,  y = posy - 1; 
  924. X                     (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  925. X!                    x++, y--) continue ;
  926. X                if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  927. X                  {
  928. X                    flag = TRUE ;
  929. X***************
  930. X*** 137,143 ****
  931. X  
  932. X                for (x = posx - 1,  y = posy - 1; 
  933. X                     (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  934. X!                    x--, y--) ;
  935. X                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  936. X                  {
  937. X                    flag = TRUE ;
  938. X--- 137,143 ----
  939. X  
  940. X                for (x = posx - 1,  y = posy - 1; 
  941. X                     (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  942. X!                    x--, y--) continue ;
  943. X                if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  944. X                  {
  945. X                    flag = TRUE ;
  946. X***************
  947. X*** 152,165 ****
  948. X  }
  949. X  
  950. X  
  951. X! jejoueen(px, py, niv)
  952. X! int px, py, niv ;
  953. X  {
  954. X    register int *d ;
  955. X!   register int x, y, posx, posy, pos8x ;
  956. X  
  957. X-   posx = px ;
  958. X-   posy = py ;
  959. X    pos8x = posx << 3 ;
  960. X  
  961. X    d = damier[niv] ;
  962. X--- 152,163 ----
  963. X  }
  964. X  
  965. X  
  966. X! jejoueen(posx, posy, niv)
  967. X! int posx, posy, niv ;
  968. X  {
  969. X    register int *d ;
  970. X!   register int x, y, pos8x ;
  971. X  
  972. X    pos8x = posx << 3 ;
  973. X  
  974. X    d = damier[niv] ;
  975. X***************
  976. X*** 166,172 ****
  977. X  
  978. X    d[pos8x + posy] = macouleur ;
  979. X  
  980. X!   for (x = posx + 1; (x < 7) && (d[(x << 3) + posy] == tacouleur); x++) ;
  981. X    if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
  982. X      {
  983. X        for (x = posx + 1; d[(x << 3) + posy] == tacouleur; x++)
  984. X--- 164,171 ----
  985. X  
  986. X    d[pos8x + posy] = macouleur ;
  987. X  
  988. X!   for (x = posx + 1;
  989. X!        (x < 7) && (d[(x << 3) + posy] == tacouleur); x++) continue ;
  990. X    if ((x != posx + 1) && (d[(x << 3) + posy] == macouleur))
  991. X      {
  992. X        for (x = posx + 1; d[(x << 3) + posy] == tacouleur; x++)
  993. X***************
  994. X*** 173,179 ****
  995. X          d[(x << 3) + posy] = macouleur ;
  996. X      }
  997. X  
  998. X!   for (x = posx - 1; (x > 0) && (d[(x << 3) + posy] == tacouleur); x--) ;
  999. X    if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
  1000. X      {
  1001. X        for (x = posx - 1; d[(x << 3) + posy] == tacouleur; x--)
  1002. X--- 172,179 ----
  1003. X          d[(x << 3) + posy] = macouleur ;
  1004. X      }
  1005. X  
  1006. X!   for (x = posx - 1;
  1007. X!        (x > 0) && (d[(x << 3) + posy] == tacouleur); x--) continue ;
  1008. X    if ((x != posx - 1) && (d[(x << 3) + posy] == macouleur))
  1009. X      {
  1010. X        for (x = posx - 1; d[(x << 3) + posy] == tacouleur; x--)
  1011. X***************
  1012. X*** 180,186 ****
  1013. X          d[(x << 3) + posy] = macouleur ;
  1014. X      }
  1015. X  
  1016. X!   for (y = posy + 1; (y < 7) && (d[pos8x + y] == tacouleur); y++) ;
  1017. X    if ((y != posy + 1) && (d[pos8x + y] == macouleur))
  1018. X      {
  1019. X        for (y = posy + 1; d[pos8x + y] == tacouleur; y++)
  1020. X--- 180,187 ----
  1021. X          d[(x << 3) + posy] = macouleur ;
  1022. X      }
  1023. X  
  1024. X!   for (y = posy + 1;
  1025. X!        (y < 7) && (d[pos8x + y] == tacouleur); y++) continue ;
  1026. X    if ((y != posy + 1) && (d[pos8x + y] == macouleur))
  1027. X      {
  1028. X        for (y = posy + 1; d[pos8x + y] == tacouleur; y++)
  1029. X***************
  1030. X*** 187,193 ****
  1031. X          d[pos8x + y] = macouleur ;
  1032. X      }
  1033. X  
  1034. X!   for (y = posy - 1; (y > 0) && (d[pos8x + y] == tacouleur); y--) ;
  1035. X    if ((y != posy - 1) && (d[pos8x + y] == macouleur))
  1036. X      {
  1037. X        for (y = posy - 1; d[pos8x + y] == tacouleur; y--)
  1038. X--- 188,195 ----
  1039. X          d[pos8x + y] = macouleur ;
  1040. X      }
  1041. X  
  1042. X!   for (y = posy - 1;
  1043. X!        (y > 0) && (d[pos8x + y] == tacouleur); y--) continue ;
  1044. X    if ((y != posy - 1) && (d[pos8x + y] == macouleur))
  1045. X      {
  1046. X        for (y = posy - 1; d[pos8x + y] == tacouleur; y--)
  1047. X***************
  1048. X*** 195,201 ****
  1049. X      }
  1050. X  
  1051. X    for (x = posx + 1, y = posy + 1;
  1052. X!        (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur); x++, y++) ;
  1053. X    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  1054. X      {
  1055. X        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x++, y++)
  1056. X--- 197,204 ----
  1057. X      }
  1058. X  
  1059. X    for (x = posx + 1, y = posy + 1;
  1060. X!        (x < 7) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  1061. X!        x++, y++) continue ;
  1062. X    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  1063. X      {
  1064. X        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x++, y++)
  1065. X***************
  1066. X*** 203,209 ****
  1067. X      }
  1068. X  
  1069. X    for (x = posx - 1, y = posy + 1;
  1070. X!        (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur); x--, y++) ;
  1071. X    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  1072. X      {
  1073. X        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x--, y++)
  1074. X--- 206,213 ----
  1075. X      }
  1076. X  
  1077. X    for (x = posx - 1, y = posy + 1;
  1078. X!        (x > 0) && (y < 7) && (d[(x << 3) + y] == tacouleur);
  1079. X!        x--, y++) continue ;
  1080. X    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  1081. X      {
  1082. X        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == tacouleur; x--, y++)
  1083. X***************
  1084. X*** 211,217 ****
  1085. X      }
  1086. X  
  1087. X    for (x = posx + 1, y = posy - 1;
  1088. X!        (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur); x++, y--) ;
  1089. X    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  1090. X      {
  1091. X        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x++, y--)
  1092. X--- 215,222 ----
  1093. X      }
  1094. X  
  1095. X    for (x = posx + 1, y = posy - 1;
  1096. X!        (x < 7) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  1097. X!        x++, y--) continue ;
  1098. X    if ((x != posx + 1) && (d[(x << 3) + y] == macouleur))
  1099. X      {
  1100. X        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x++, y--)
  1101. X***************
  1102. X*** 219,225 ****
  1103. X      }
  1104. X  
  1105. X    for (x = posx - 1, y = posy - 1;
  1106. X!        (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur); x--, y--) ;
  1107. X    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  1108. X      {
  1109. X        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x--, y--)
  1110. X--- 224,231 ----
  1111. X      }
  1112. X  
  1113. X    for (x = posx - 1, y = posy - 1;
  1114. X!        (x > 0) && (y > 0) && (d[(x << 3) + y] == tacouleur);
  1115. X!        x--, y--) continue ;
  1116. X    if ((x != posx - 1) && (d[(x << 3) + y] == macouleur))
  1117. X      {
  1118. X        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == tacouleur; x--, y--)
  1119. X***************
  1120. X*** 249,255 ****
  1121. X              {
  1122. X                for (x = posx + 1;
  1123. X                     (x < 7) && (d[(x << 3) + posy] == macouleur);
  1124. X!                    x++) ;
  1125. X                if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
  1126. X                  {
  1127. X                    flag = TRUE ;
  1128. X--- 255,261 ----
  1129. X              {
  1130. X                for (x = posx + 1;
  1131. X                     (x < 7) && (d[(x << 3) + posy] == macouleur);
  1132. X!                    x++) continue ;
  1133. X                if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
  1134. X                  {
  1135. X                    flag = TRUE ;
  1136. X***************
  1137. X*** 260,266 ****
  1138. X  
  1139. X                for (x = posx - 1;
  1140. X                     (x > 0) && (d[(x << 3) + posy] == macouleur) ;
  1141. X!                    x--) ;
  1142. X                if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
  1143. X                  {
  1144. X                    flag = TRUE ;
  1145. X--- 266,272 ----
  1146. X  
  1147. X                for (x = posx - 1;
  1148. X                     (x > 0) && (d[(x << 3) + posy] == macouleur) ;
  1149. X!                    x--) continue ;
  1150. X                if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
  1151. X                  {
  1152. X                    flag = TRUE ;
  1153. X***************
  1154. X*** 271,277 ****
  1155. X  
  1156. X                for (y = posy + 1;
  1157. X                     (y < 7) && (d[pos8x + y] == macouleur);
  1158. X!                    y++) ;
  1159. X                if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
  1160. X                  {
  1161. X                    flag = TRUE ;
  1162. X--- 277,283 ----
  1163. X  
  1164. X                for (y = posy + 1;
  1165. X                     (y < 7) && (d[pos8x + y] == macouleur);
  1166. X!                    y++) continue ;
  1167. X                if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
  1168. X                  {
  1169. X                    flag = TRUE ;
  1170. X***************
  1171. X*** 282,288 ****
  1172. X  
  1173. X                for (y = posy - 1;
  1174. X                     (y > 0) && (d[pos8x + y] == macouleur);
  1175. X!                    y--) ;
  1176. X                if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
  1177. X                  {
  1178. X                    flag = TRUE ;
  1179. X--- 288,294 ----
  1180. X  
  1181. X                for (y = posy - 1;
  1182. X                     (y > 0) && (d[pos8x + y] == macouleur);
  1183. X!                    y--) continue ;
  1184. X                if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
  1185. X                  {
  1186. X                    flag = TRUE ;
  1187. X***************
  1188. X*** 293,299 ****
  1189. X  
  1190. X                for (x = posx + 1,  y = posy + 1; 
  1191. X                     (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1192. X!                    x++, y++);
  1193. X                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1194. X                  {
  1195. X                    flag = TRUE ;
  1196. X--- 299,305 ----
  1197. X  
  1198. X                for (x = posx + 1,  y = posy + 1; 
  1199. X                     (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1200. X!                    x++, y++) continue ;
  1201. X                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1202. X                  {
  1203. X                    flag = TRUE ;
  1204. X***************
  1205. X*** 304,310 ****
  1206. X  
  1207. X                for (x = posx - 1,  y = posy + 1; 
  1208. X                     (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1209. X!                    x--, y++) ;
  1210. X                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1211. X                  {
  1212. X                    flag = TRUE ;
  1213. X--- 310,316 ----
  1214. X  
  1215. X                for (x = posx - 1,  y = posy + 1; 
  1216. X                     (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1217. X!                    x--, y++) continue ;
  1218. X                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1219. X                  {
  1220. X                    flag = TRUE ;
  1221. X***************
  1222. X*** 315,321 ****
  1223. X  
  1224. X                for (x = posx + 1,  y = posy - 1; 
  1225. X                     (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1226. X!                    x++, y--) ;
  1227. X                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1228. X                  {
  1229. X                    flag = TRUE ;
  1230. X--- 321,327 ----
  1231. X  
  1232. X                for (x = posx + 1,  y = posy - 1; 
  1233. X                     (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1234. X!                    x++, y--) continue ;
  1235. X                if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1236. X                  {
  1237. X                    flag = TRUE ;
  1238. X***************
  1239. X*** 326,332 ****
  1240. X  
  1241. X                for (x = posx - 1,  y = posy - 1; 
  1242. X                     (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur) ;
  1243. X!                    x--, y-- ) ;
  1244. X                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1245. X                  {
  1246. X                    flag = TRUE ;
  1247. X--- 332,338 ----
  1248. X  
  1249. X                for (x = posx - 1,  y = posy - 1; 
  1250. X                     (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur) ;
  1251. X!                    x--, y-- ) continue ;
  1252. X                if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1253. X                  {
  1254. X                    flag = TRUE ;
  1255. X***************
  1256. X*** 341,360 ****
  1257. X  }
  1258. X  
  1259. X  
  1260. X! tujouesen(px, py, niv)
  1261. X! int px, py, niv ;
  1262. X  {
  1263. X    register int *d ;
  1264. X!   register int x, y, posx, posy, pos8x ;
  1265. X  
  1266. X-   posx = px ;
  1267. X-   posy = py ;
  1268. X- 
  1269. X    pos8x = posx << 3 ;
  1270. X    d = damier[niv] ;
  1271. X    d[pos8x + posy] = tacouleur ;
  1272. X  
  1273. X!   for (x = posx + 1; (x < 7) && (d[(x << 3) + posy] == macouleur); x++) ;
  1274. X    if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
  1275. X      {
  1276. X        for (x = posx + 1; d[(x << 3) + posy] == macouleur; x++)
  1277. X--- 347,364 ----
  1278. X  }
  1279. X  
  1280. X  
  1281. X! tujouesen(posx, posy, niv)
  1282. X! int posx, posy, niv ;
  1283. X  {
  1284. X    register int *d ;
  1285. X!   register int x, y, pos8x ;
  1286. X  
  1287. X    pos8x = posx << 3 ;
  1288. X    d = damier[niv] ;
  1289. X    d[pos8x + posy] = tacouleur ;
  1290. X  
  1291. X!   for (x = posx + 1;
  1292. X!        (x < 7) && (d[(x << 3) + posy] == macouleur); x++) continue ;
  1293. X    if ((x != posx + 1) && (d[(x << 3) + posy] == tacouleur))
  1294. X      {
  1295. X        for (x = posx + 1; d[(x << 3) + posy] == macouleur; x++)
  1296. X***************
  1297. X*** 361,367 ****
  1298. X          d[(x << 3) + posy] = tacouleur ;
  1299. X      }
  1300. X  
  1301. X!   for (x = posx - 1; (x > 0) && (d[(x << 3) + posy] == macouleur); x--) ;
  1302. X    if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
  1303. X      {
  1304. X        for (x = posx - 1; d[(x << 3) + posy] == macouleur; x--)
  1305. X--- 365,372 ----
  1306. X          d[(x << 3) + posy] = tacouleur ;
  1307. X      }
  1308. X  
  1309. X!   for (x = posx - 1;
  1310. X!        (x > 0) && (d[(x << 3) + posy] == macouleur); x--) continue ;
  1311. X    if ((x != posx - 1) && (d[(x << 3) + posy] == tacouleur))
  1312. X      {
  1313. X        for (x = posx - 1; d[(x << 3) + posy] == macouleur; x--)
  1314. X***************
  1315. X*** 368,374 ****
  1316. X          d[(x << 3) + posy] = tacouleur ;
  1317. X      }
  1318. X  
  1319. X!   for (y = posy + 1; (y < 7) && (d[pos8x + y] == macouleur); y++) ;
  1320. X    if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
  1321. X      {
  1322. X        for (y = posy + 1; d[pos8x + y] == macouleur; y++)
  1323. X--- 373,380 ----
  1324. X          d[(x << 3) + posy] = tacouleur ;
  1325. X      }
  1326. X  
  1327. X!   for (y = posy + 1;
  1328. X!        (y < 7) && (d[pos8x + y] == macouleur); y++) continue ;
  1329. X    if ((y != posy + 1) && (d[pos8x + y] == tacouleur))
  1330. X      {
  1331. X        for (y = posy + 1; d[pos8x + y] == macouleur; y++)
  1332. X***************
  1333. X*** 375,381 ****
  1334. X          d[pos8x + y] = tacouleur ;
  1335. X      }
  1336. X  
  1337. X!   for (y = posy - 1; (y > 0) && (d[pos8x + y] == macouleur); y--) ;
  1338. X    if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
  1339. X      {
  1340. X        for (y = posy - 1; d[pos8x + y] == macouleur; y--)
  1341. X--- 381,388 ----
  1342. X          d[pos8x + y] = tacouleur ;
  1343. X      }
  1344. X  
  1345. X!   for (y = posy - 1;
  1346. X!        (y > 0) && (d[pos8x + y] == macouleur); y--) continue ;
  1347. X    if ((y != posy - 1) && (d[pos8x + y] == tacouleur))
  1348. X      {
  1349. X        for (y = posy - 1; d[pos8x + y] == macouleur; y--)
  1350. X***************
  1351. X*** 384,390 ****
  1352. X  
  1353. X    for (x = posx + 1, y = posy + 1;
  1354. X         (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1355. X!        x++, y++) ;
  1356. X    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1357. X      {
  1358. X        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == macouleur; x++, y++)
  1359. X--- 391,397 ----
  1360. X  
  1361. X    for (x = posx + 1, y = posy + 1;
  1362. X         (x < 7) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1363. X!        x++, y++) continue ;
  1364. X    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1365. X      {
  1366. X        for (x = posx + 1, y = posy + 1; d[(x << 3) + y] == macouleur; x++, y++)
  1367. X***************
  1368. X*** 393,399 ****
  1369. X  
  1370. X    for (x = posx - 1, y = posy + 1;
  1371. X         (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1372. X!        x--, y++) ;
  1373. X    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1374. X      {
  1375. X        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == macouleur; x--, y++)
  1376. X--- 400,406 ----
  1377. X  
  1378. X    for (x = posx - 1, y = posy + 1;
  1379. X         (x > 0) && (y < 7) && (d[(x << 3) + y] == macouleur);
  1380. X!        x--, y++) continue ;
  1381. X    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1382. X      {
  1383. X        for (x = posx - 1, y = posy + 1; d[(x << 3) + y] == macouleur; x--, y++)
  1384. X***************
  1385. X*** 402,408 ****
  1386. X  
  1387. X    for (x = posx + 1, y = posy - 1;
  1388. X         (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1389. X!        x++, y--) ;
  1390. X    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1391. X      {
  1392. X        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == macouleur; x++, y--)
  1393. X--- 409,415 ----
  1394. X  
  1395. X    for (x = posx + 1, y = posy - 1;
  1396. X         (x < 7) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1397. X!        x++, y--) continue ;
  1398. X    if ((x != posx + 1) && (d[(x << 3) + y] == tacouleur))
  1399. X      {
  1400. X        for (x = posx + 1, y = posy - 1; d[(x << 3) + y] == macouleur; x++, y--)
  1401. X***************
  1402. X*** 411,417 ****
  1403. X  
  1404. X    for (x = posx - 1, y = posy - 1;
  1405. X         (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1406. X!        x--, y--) ;
  1407. X    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1408. X      {
  1409. X        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == macouleur; x--, y--)
  1410. X--- 418,424 ----
  1411. X  
  1412. X    for (x = posx - 1, y = posy - 1;
  1413. X         (x > 0) && (y > 0) && (d[(x << 3) + y] == macouleur);
  1414. X!        x--, y--) continue ;
  1415. X    if ((x != posx - 1) && (d[(x << 3) + y] == tacouleur))
  1416. X      {
  1417. X        for (x = posx - 1, y = posy - 1; d[(x << 3) + y] == macouleur; x--, y--)
  1418. X
  1419. END_OF_FILE
  1420. if test 46204 -ne `wc -c <'patches02b'`; then
  1421.     echo shar: \"'patches02b'\" unpacked with wrong size!
  1422. fi
  1423. # end of 'patches02b'
  1424. fi
  1425. echo shar: End of archive 2 \(of 3\).
  1426. cp /dev/null ark2isdone
  1427. MISSING=""
  1428. for I in 1 2 3 ; do
  1429.     if test ! -f ark${I}isdone ; then
  1430.     MISSING="${MISSING} ${I}"
  1431.     fi
  1432. done
  1433. if test "${MISSING}" = "" ; then
  1434.     echo You have unpacked all 3 archives.
  1435.     rm -f ark[1-9]isdone
  1436. else
  1437.     echo You still need to unpack the following archives:
  1438.     echo "        " ${MISSING}
  1439. fi
  1440. ##  End of shell archive.
  1441. exit 0
  1442.