home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume11 / reve / patch1b < prev    next >
Encoding:
Internet Message Format  |  1990-12-11  |  53.9 KB

  1. Path: uunet!ogicse!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i062:  reve - an othello game, Patch1b
  5. Message-ID: <6566@tekred.CNA.TEK.COM>
  6. Date: 16 Nov 90 18:54:05 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1572
  9. Approved: billr@saab.CNA.TEK.COM
  10. Posted: Fri Nov 16 10:54:05 1990
  11.  
  12. Submitted-by: Rich Burridge <rburridge@sun.COM>
  13. Posting-number: Volume 11, Issue 62
  14. Archive-name: reve/Patch1b
  15. Patch-To: reve: Volume 11, Issue 52-58
  16. Environment: SunView, XView, X11R4, termcap
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 2 (of 4)."
  27. # Contents:  patches01b
  28. # Wrapped by billr@saab on Fri Nov 16 10:46:43 1990
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'patches01b' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'patches01b'\"
  32. else
  33. echo shar: Extracting \"'patches01b'\" \(51889 characters\)
  34. sed "s/^X//" >'patches01b' <<'END_OF_FILE'
  35. X
  36. X------- color.h -------
  37. X*** /tmp/da28728    Fri Nov  9 10:28:40 1990
  38. X--- color.h    Mon Nov  5 09:10:15 1990
  39. X***************
  40. X*** 6,16 ****
  41. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  42. X   *  All rights reserved.
  43. X   *
  44. X!  *  Permission is given to distribute these sources, as long as the
  45. X!  *  introductory messages are not removed, and no monies are exchanged.
  46. X   *
  47. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  48. X!  *  any tournaments, without the permission of the authors.
  49. X   *
  50. X   *  No responsibility is taken for any errors or inaccuracies inherent
  51. X   *  either to the comments or the code of this program, but if reported
  52. X--- 6,21 ----
  53. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  54. X   *  All rights reserved.
  55. X   *
  56. X!  *  Permission is granted to copy this source, for redistribution
  57. X!  *  in source form only, provided the news headers in "substantially
  58. X!  *  unaltered format" are retained, the introductory messages are not
  59. X!  *  removed, and no monies are exchanged.
  60. X   *
  61. X!  *  Permission is also granted to copy this source, without the
  62. X!  *  news headers, for the purposes of making an executable copy by
  63. X!  *  means of compilation, provided that such copy will not be used
  64. X!  *  for the purposes of competition in any othello tournaments, without
  65. X!  *  prior permission from the authors.
  66. X   *
  67. X   *  No responsibility is taken for any errors or inaccuracies inherent
  68. X   *  either to the comments or the code of this program, but if reported
  69. X
  70. X------- events.c -------
  71. X*** /tmp/da28731    Fri Nov  9 10:28:41 1990
  72. X--- events.c    Wed Nov  7 21:09:27 1990
  73. X***************
  74. X*** 7,17 ****
  75. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  76. X   *  All rights reserved.
  77. X   *
  78. X!  *  Permission is given to distribute these sources, as long as the
  79. X!  *  introductory messages are not removed, and no monies are exchanged.
  80. X   *
  81. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  82. X!  *  any tournaments, without the permission of the authors.
  83. X   *
  84. X   *  No responsibility is taken for any errors on inaccuracies inherent
  85. X   *  either to the comments or the code of this program, but if reported
  86. X--- 7,22 ----
  87. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  88. X   *  All rights reserved.
  89. X   *
  90. X!  *  Permission is granted to copy this source, for redistribution
  91. X!  *  in source form only, provided the news headers in "substantially
  92. X!  *  unaltered format" are retained, the introductory messages are not
  93. X!  *  removed, and no monies are exchanged.
  94. X   *
  95. X!  *  Permission is also granted to copy this source, without the
  96. X!  *  news headers, for the purposes of making an executable copy by
  97. X!  *  means of compilation, provided that such copy will not be used
  98. X!  *  for the purposes of competition in any othello tournaments, without
  99. X!  *  prior permission from the authors.
  100. X   *
  101. X   *  No responsibility is taken for any errors on inaccuracies inherent
  102. X   *  either to the comments or the code of this program, but if reported
  103. X***************
  104. X*** 18,24 ****
  105. X   *  (see README file), then an attempt will be made to fix them.
  106. X   */
  107. X  
  108. X- #include <stdio.h>
  109. X  #include "reve.h"
  110. X  #include "color.h"
  111. X  #include "extern.h"
  112. X--- 23,28 ----
  113. X***************
  114. X*** 166,172 ****
  115. X        switch (item)
  116. X          {
  117. X            case BLACK_PLAYS :
  118. X!                WHITE_PLAYS : if (item == BLACK_PLAYS) curx = 0 ;
  119. X                               else curx = BBORDER + (3*(BWIDTH+BGAP)) ;
  120. X                               switch (ch)
  121. X                                 {
  122. X--- 170,176 ----
  123. X        switch (item)
  124. X          {
  125. X            case BLACK_PLAYS :
  126. X!           case WHITE_PLAYS : if (item == BLACK_PLAYS) curx = 0 ;
  127. X                               else curx = BBORDER + (3*(BWIDTH+BGAP)) ;
  128. X                               switch (ch)
  129. X                                 {
  130. X***************
  131. X*** 247,254 ****
  132. X                                nextc == RIGHT_DOWN)
  133. X                              {
  134. X                                set_cursor(NOCURSOR) ;
  135. X!                               piece_x = curx - BBORDER - (PIECE_RAD) ;
  136. X!                               piece_y = cury - BBORDER - (PIECE_RAD) ;
  137. X                                draw_piece(next_player, piece_x, piece_y, RINV) ;
  138. X                                cmode = (enum cantype) ((int) cmode + 1) ;
  139. X                              }
  140. X--- 251,258 ----
  141. X                                nextc == RIGHT_DOWN)
  142. X                              {
  143. X                                set_cursor(NOCURSOR) ;
  144. X!                               piece_x = curx - PIECE_RAD ;
  145. X!                               piece_y = cury - PIECE_RAD ;
  146. X                                draw_piece(next_player, piece_x, piece_y, RINV) ;
  147. X                                cmode = (enum cantype) ((int) cmode + 1) ;
  148. X                              }
  149. X***************
  150. X*** 319,325 ****
  151. X        case 'W' : do_cycle_key(WHITE_PLAYS, nextc) ;
  152. X                   break ;
  153. X  
  154. X!       case 'l' : last() ;                              /* Button items. */
  155. X                   break ;
  156. X        case 'L' : curx = 0 ;
  157. X                   draw_textfield() ;
  158. X--- 323,329 ----
  159. X        case 'W' : do_cycle_key(WHITE_PLAYS, nextc) ;
  160. X                   break ;
  161. X  
  162. X!       case 'A' : show_all_moves() ;                    /* Button items. */
  163. X                   break ;
  164. X        case 'L' : curx = 0 ;
  165. X                   draw_textfield() ;
  166. X
  167. X------- extern.h -------
  168. X*** /tmp/da28734    Fri Nov  9 10:28:42 1990
  169. X--- extern.h    Wed Nov  7 14:57:04 1990
  170. X***************
  171. X*** 6,16 ****
  172. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  173. X   *  All rights reserved.
  174. X   *
  175. X!  *  Permission is given to distribute these sources, as long as the
  176. X!  *  introductory messages are not removed, and no monies are exchanged.
  177. X   *
  178. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  179. X!  *  any tournaments, without the permission of the authors.
  180. X   *
  181. X   *  No responsibility is taken for any errors on inaccuracies inherent
  182. X   *  either to the comments or the code of this program, but if reported
  183. X--- 6,21 ----
  184. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  185. X   *  All rights reserved.
  186. X   *
  187. X!  *  Permission is granted to copy this source, for redistribution
  188. X!  *  in source form only, provided the news headers in "substantially
  189. X!  *  unaltered format" are retained, the introductory messages are not
  190. X!  *  removed, and no monies are exchanged.
  191. X   *
  192. X!  *  Permission is also granted to copy this source, without the
  193. X!  *  news headers, for the purposes of making an executable copy by
  194. X!  *  means of compilation, provided that such copy will not be used
  195. X!  *  for the purposes of competition in any othello tournaments, without
  196. X!  *  prior permission from the authors.
  197. X   *
  198. X   *  No responsibility is taken for any errors on inaccuracies inherent
  199. X   *  either to the comments or the code of this program, but if reported
  200. X***************
  201. X*** 23,29 ****
  202. X  extern int cur_ch ;        /* Current character pressed. */
  203. X  extern int curx ;          /* Current mouse X position. */
  204. X  extern int cury ;          /* Current mouse Y position. */
  205. X- extern int depth ;         /* Depth of search for computers move. */
  206. X  extern int down ;          /* Indicates is a mouse button is down. */
  207. X  extern int first_move ;    /* Set if computer plays first move. */
  208. X  extern int iconic ;        /* Start as an icon if set. */
  209. X--- 28,33 ----
  210. X***************
  211. X*** 34,41 ****
  212. X--- 38,47 ----
  213. X  extern int ix ;            /* Initial X position of the icon. */
  214. X  extern int iy ;            /* Initial Y position of the icon. */
  215. X  extern int last_move ;     /* Last valid computer move. */
  216. X+ extern int level ;         /* Current difficulty level for computer moves. */
  217. X  extern int loadgame ;      /* Set if there is a game file to load. */
  218. X  extern int lsval ;         /* Set to 'l' or 's', if loading or saving. */
  219. X+ extern int monochrome ;    /* If set, display will be in monochrome. */
  220. X  extern int move ;          /* Current move being evaluated. */
  221. X  extern int move_delta ;    /* Delta for piece animation. */
  222. X  extern int nextc ;         /* Current event identifier. */
  223. X***************
  224. X*** 51,56 ****
  225. X--- 57,63 ----
  226. X  extern int s_player ;
  227. X  extern int s_row ;
  228. X  extern int s_col ;
  229. X+ extern int show_moves ;    /* If set, all possible moves are being shown. */
  230. X  extern int show_notes ;    /* If set, display notes value from play_reve. */
  231. X  extern int suggestion ;    /* Positive if a suggested move. */
  232. X  extern int suggest_x ;     /* X position of suggested move. */
  233. X***************
  234. X*** 62,67 ****
  235. X--- 69,75 ----
  236. X  extern int wx ;            /* Initial X position of the window. */
  237. X  extern int wy ;            /* Initial Y position of the window. */ 
  238. X  
  239. X+ extern time_t timeleft ;   /* Amount of time left for computer moves. */
  240. X  extern long note ;         /* Note value for current computer move. */
  241. X  
  242. X  extern char *diff_values[] ;     /* Values for cyclic difficulty button. */
  243. X***************
  244. X*** 74,81 ****
  245. X  extern char progname[] ;         /* The name of this program. */
  246. X  extern char revtable[] ;         /* Table for reversing bits in a byte. */
  247. X  
  248. X! extern char black_dpy[] ;        /* Black piece display information. */
  249. X! extern char white_dpy[] ;        /* White piece display information. */
  250. X  
  251. X  extern FILE *rem_fp ;
  252. X  extern struct timeval tp ;        /* Used by the nap_upto routine. */
  253. X--- 82,89 ----
  254. X  extern char progname[] ;         /* The name of this program. */
  255. X  extern char revtable[] ;         /* Table for reversing bits in a byte. */
  256. X  
  257. X! extern char *black_dpy ;         /* Black piece display information. */
  258. X! extern char *white_dpy ;         /* White piece display information. */
  259. X  
  260. X  extern FILE *rem_fp ;
  261. X  extern struct timeval tp ;        /* Used by the nap_upto routine. */
  262. X***************
  263. X*** 85,90 ****
  264. X--- 93,99 ----
  265. X  extern BOARD board ;              /* The current reve board. */
  266. X  extern BOARD old_board ;          /* The previous reve board. */
  267. X  extern BOARD *s_pos ;
  268. X+ extern BOARD s_all ;              /* List of valid positions for this move. */ 
  269. X  extern BOARD moves[64] ;          /* Complete array of board moves. */
  270. X  
  271. X  extern enum cantype cmode, last_cmode ;
  272. X
  273. X------- images.h -------
  274. X*** /tmp/da28737    Fri Nov  9 10:28:42 1990
  275. X--- images.h    Tue Nov  6 18:21:08 1990
  276. X***************
  277. X*** 6,16 ****
  278. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  279. X   *  All rights reserved.
  280. X   *
  281. X!  *  Permission is given to distribute these sources, as long as the
  282. X!  *  introductory messages are not removed, and no monies are exchanged.
  283. X   *
  284. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  285. X!  *  any tournaments, without the permission of the authors.
  286. X   *
  287. X   *  No responsibility is taken for any errors or inaccuracies inherent
  288. X   *  either to the comments or the code of this program, but if reported
  289. X--- 6,21 ----
  290. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  291. X   *  All rights reserved.
  292. X   *
  293. X!  *  Permission is granted to copy this source, for redistribution
  294. X!  *  in source form only, provided the news headers in "substantially
  295. X!  *  unaltered format" are retained, the introductory messages are not
  296. X!  *  removed, and no monies are exchanged.
  297. X   *
  298. X!  *  Permission is also granted to copy this source, without the
  299. X!  *  news headers, for the purposes of making an executable copy by
  300. X!  *  means of compilation, provided that such copy will not be used
  301. X!  *  for the purposes of competition in any othello tournaments, without
  302. X!  *  prior permission from the authors.
  303. X   *
  304. X   *  No responsibility is taken for any errors or inaccuracies inherent
  305. X   *  either to the comments or the code of this program, but if reported
  306. X***************
  307. X*** 18,48 ****
  308. X   */
  309. X  
  310. X  unsigned short button_stencil_image[] = {
  311. X! #include "images/button.stencil.icon"
  312. X  } ;
  313. X  
  314. X  unsigned short button_invert_image[] = {
  315. X! #include "images/button.invert.icon"
  316. X  } ;
  317. X  
  318. X  unsigned short button_normal_image[] = {
  319. X! #include "images/button.normal.icon"
  320. X  } ;
  321. X  
  322. X  unsigned short cycle_glyph_image[] = {
  323. X! #include "images/cycle.glyph.icon"
  324. X  } ;
  325. X  
  326. X  unsigned short cycle_stencil_image[] = {
  327. X! #include "images/cycle.stencil.icon"
  328. X  } ;
  329. X  
  330. X  unsigned short cycle_linvert_image[] = {
  331. X! #include "images/cycle.linvert.icon"
  332. X  } ;
  333. X  
  334. X  unsigned short cycle_rinvert_image[] = {
  335. X! #include "images/cycle.rinvert.icon"
  336. X  } ;
  337. X  
  338. X  unsigned short icon_image[] = {
  339. X--- 23,53 ----
  340. X   */
  341. X  
  342. X  unsigned short button_stencil_image[] = {
  343. X! #include "images/Sbutton.icon"
  344. X  } ;
  345. X  
  346. X  unsigned short button_invert_image[] = {
  347. X! #include "images/Ibutton.icon"
  348. X  } ;
  349. X  
  350. X  unsigned short button_normal_image[] = {
  351. X! #include "images/Nbutton.icon"
  352. X  } ;
  353. X  
  354. X  unsigned short cycle_glyph_image[] = {
  355. X! #include "images/Ncycle.icon"
  356. X  } ;
  357. X  
  358. X  unsigned short cycle_stencil_image[] = {
  359. X! #include "images/Scycle.icon"
  360. X  } ;
  361. X  
  362. X  unsigned short cycle_linvert_image[] = {
  363. X! #include "images/Lcycle.icon"
  364. X  } ;
  365. X  
  366. X  unsigned short cycle_rinvert_image[] = {
  367. X! #include "images/Rcycle.icon"
  368. X  } ;
  369. X  
  370. X  unsigned short icon_image[] = {
  371. X***************
  372. X*** 50,56 ****
  373. X  } ;
  374. X  
  375. X  unsigned short cicon_image[] = {
  376. X! #include "images/reve.color.icon"
  377. X  } ;
  378. X  
  379. X  unsigned short hglass_image[] = {
  380. X--- 55,61 ----
  381. X  } ;
  382. X  
  383. X  unsigned short cicon_image[] = {
  384. X! #include "images/Creve.icon"
  385. X  } ;
  386. X  
  387. X  unsigned short hglass_image[] = {
  388. X
  389. X------- items.c -------
  390. X*** /tmp/da28740    Fri Nov  9 10:28:43 1990
  391. X--- items.c    Mon Nov  5 09:05:39 1990
  392. X***************
  393. X*** 7,17 ****
  394. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  395. X   *  All rights reserved.
  396. X   *
  397. X!  *  Permission is given to distribute these sources, as long as the
  398. X!  *  introductory messages are not removed, and no monies are exchanged.
  399. X   *
  400. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  401. X!  *  any tournaments, without the permission of the authors.
  402. X   *
  403. X   *  No responsibility is taken for any errors on inaccuracies inherent
  404. X   *  either to the comments or the code of this program, but if reported
  405. X--- 7,22 ----
  406. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  407. X   *  All rights reserved.
  408. X   *
  409. X!  *  Permission is granted to copy this source, for redistribution
  410. X!  *  in source form only, provided the news headers in "substantially
  411. X!  *  unaltered format" are retained, the introductory messages are not
  412. X!  *  removed, and no monies are exchanged.
  413. X   *
  414. X!  *  Permission is also granted to copy this source, without the
  415. X!  *  news headers, for the purposes of making an executable copy by
  416. X!  *  means of compilation, provided that such copy will not be used
  417. X!  *  for the purposes of competition in any othello tournaments, without
  418. X!  *  prior permission from the authors.
  419. X   *
  420. X   *  No responsibility is taken for any errors on inaccuracies inherent
  421. X   *  either to the comments or the code of this program, but if reported
  422. X***************
  423. X*** 18,30 ****
  424. X   *  (see README file), then an attempt will be made to fix them.
  425. X   */
  426. X  
  427. X- #include <stdio.h>
  428. X- #include <strings.h>
  429. X- #include "color.h"
  430. X  #include "reve.h"
  431. X  #include "extern.h"
  432. X  
  433. X  
  434. X  void
  435. X  draw_button(item, color, image)      /* Draw a panel button. */
  436. X  enum panel_type item ;
  437. X--- 23,39 ----
  438. X   *  (see README file), then an attempt will be made to fix them.
  439. X   */
  440. X  
  441. X  #include "reve.h"
  442. X+ #include "color.h"
  443. X  #include "extern.h"
  444. X  
  445. X+ #ifdef SYSV
  446. X+ #include "string.h"
  447. X+ #else
  448. X+ #include <strings.h>
  449. X+ #endif /*SYSV*/ 
  450. X  
  451. X+ 
  452. X  void
  453. X  draw_button(item, color, image)      /* Draw a panel button. */
  454. X  enum panel_type item ;
  455. X***************
  456. X*** 107,139 ****
  457. X  
  458. X  
  459. X  void
  460. X- draw_piece(piece, x, y, op)    /* Draw an othello piece on the board. */
  461. X- int piece, x, y ;
  462. X- enum optype op ;
  463. X- {
  464. X-   switch (piece)
  465. X-     {
  466. X-       case BLACK : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
  467. X-                                 P_BLACK, P_BLACK) ;
  468. X-                    break ;
  469. X-       case WHITE : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
  470. X-                                 P_BLACK, P_WHITE) ;
  471. X-     }
  472. X- }
  473. X- 
  474. X- 
  475. X- void
  476. X- draw_rect(x1, y1, x2, y2)
  477. X- int x1, y1, x2, y2 ;
  478. X- {
  479. X-   draw_line(x1, y1, x2, y1, RSRC, C_BLACK) ;
  480. X-   draw_line(x1, y1, x1, y2, RSRC, C_BLACK) ;
  481. X-   draw_line(x2, y1, x2, y2, RSRC, C_BLACK) ;
  482. X-   draw_line(x1, y2, x2, y2, RSRC, C_BLACK) ;
  483. X- }
  484. X- 
  485. X- 
  486. X- void
  487. X  draw_textfield()
  488. X  {
  489. X    int x1, y1 ;
  490. X--- 116,121 ----
  491. X***************
  492. X*** 142,148 ****
  493. X    x1 = BBORDER + BWIDTH + (BGAP / 2) ;
  494. X    y1 = BBORDER + BHEIGHT + (BGAP / 2) ;
  495. X    color_area(x1, y1, 4 * (BWIDTH + BGAP), BHEIGHT + BGAP, C_WHITE) ;
  496. X!   draw_rect(x1, y1, x1 + (4 * (BWIDTH + BGAP)) - 1, y1 + BHEIGHT + BGAP - 1) ;
  497. X    draw_text(BBORDER + BWIDTH + BGAP, BBORDER + BHEIGHT + BGAP +
  498. X              (nfont_height + (BHEIGHT - nfont_height) / 2) - 5,
  499. X              BFONT, C_BLACK, "File:") ;
  500. X--- 124,131 ----
  501. X    x1 = BBORDER + BWIDTH + (BGAP / 2) ;
  502. X    y1 = BBORDER + BHEIGHT + (BGAP / 2) ;
  503. X    color_area(x1, y1, 4 * (BWIDTH + BGAP), BHEIGHT + BGAP, C_WHITE) ;
  504. X!   draw_rect(x1, y1, x1 + (4 * (BWIDTH + BGAP)) - 1,
  505. X!                 y1 + BHEIGHT + BGAP - 1, RSRC, C_BLACK) ;
  506. X    draw_text(BBORDER + BWIDTH + BGAP, BBORDER + BHEIGHT + BGAP +
  507. X              (nfont_height + (BHEIGHT - nfont_height) / 2) - 5,
  508. X              BFONT, C_BLACK, "File:") ;
  509. X***************
  510. X*** 210,219 ****
  511. X  void
  512. X  make_panel()
  513. X  {
  514. X-   draw_button(LAST_BUT,     C_LGREY, BUT_NORMAL) ;
  515. X    draw_button(LOAD_BUT,     C_LGREY, BUT_NORMAL) ;
  516. X    draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
  517. X    draw_button(SAVE_BUT,     C_LGREY, BUT_NORMAL) ;
  518. X    draw_button(SUGGEST_BUT,  C_LGREY, BUT_NORMAL) ;
  519. X    draw_button(UNDO_BUT,     C_LGREY, BUT_NORMAL) ;
  520. X  
  521. X--- 193,202 ----
  522. X  void
  523. X  make_panel()
  524. X  {
  525. X    draw_button(LOAD_BUT,     C_LGREY, BUT_NORMAL) ;
  526. X    draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
  527. X    draw_button(SAVE_BUT,     C_LGREY, BUT_NORMAL) ;
  528. X+   draw_button(SHOW_ALL_BUT, C_LGREY, BUT_NORMAL) ;
  529. X    draw_button(SUGGEST_BUT,  C_LGREY, BUT_NORMAL) ;
  530. X    draw_button(UNDO_BUT,     C_LGREY, BUT_NORMAL) ;
  531. X  
  532. X***************
  533. X*** 226,232 ****
  534. X    draw_cycle_item(NOTES,       notes_values,  C_LGREY, CY_NORMAL) ;
  535. X  
  536. X    make_message(PANEL_MES) ;
  537. X!   make_message(NOTES_MES) ;
  538. X    make_message(SCORE_MES) ;
  539. X    make_message(TURN_MES) ;
  540. X  }
  541. X--- 209,215 ----
  542. X    draw_cycle_item(NOTES,       notes_values,  C_LGREY, CY_NORMAL) ;
  543. X  
  544. X    make_message(PANEL_MES) ;
  545. X!   make_message(EVAL_MES) ;
  546. X    make_message(SCORE_MES) ;
  547. X    make_message(TURN_MES) ;
  548. X  }
  549. X
  550. X------- reve.man -------
  551. X*** /tmp/da28765    Fri Nov  9 10:32:20 1990
  552. X--- reve.man    Fri Nov  9 10:31:20 1990
  553. X***************
  554. X*** 10,17 ****
  555. X  
  556. X  SYNOPSIS
  557. X       reve [ -b [ display ] ] [ -c ] [ -d difficulty ] [ -e  edge-
  558. X!      file  ] [ -g geometry ] [ -i ] [ -l gamefile ] [ -n ] [ -v ]
  559. X!      [ -w [ display ] ] [ -? ] [ -Wi ] [ -Wp x y ] [ -WP x y ]
  560. X  
  561. X  DESCRIPTION
  562. X       Reve is a version of the popular Othello game.  It  contains
  563. X--- 10,18 ----
  564. X  
  565. X  SYNOPSIS
  566. X       reve [ -b [ display ] ] [ -c ] [ -d difficulty ] [ -e  edge-
  567. X!      file  ] [ -g geometry ] [ -i ] [ -l gamefile ] [ -m ] [ -n ]
  568. X!      [ -r ] [ -v ] [ -w [ display ] ] [ -? ] [ -Wi ] [ -Wp x y  ]
  569. X!      [ -WP x y ]
  570. X  
  571. X  DESCRIPTION
  572. X       Reve is a version of the popular Othello game.  It  contains
  573. X***************
  574. X*** 38,44 ****
  575. X       go. Note that it is also possible to supply a number  and  a
  576. X       letter pair, to indicate where you would like your new piece
  577. X       to go. This is the only method to place pieces with the dumb
  578. X!      tty interface.
  579. X  
  580. X       There are various buttons and cyclic  selections  available.
  581. X       Their  meanings are given below, plus an indication of their
  582. X--- 39,47 ----
  583. X       go. Note that it is also possible to supply a number  and  a
  584. X       letter pair, to indicate where you would like your new piece
  585. X       to go. This is the only method to place pieces with the dumb
  586. X!      tty  interface.  The square containing the last move will be
  587. X!      shown with a black outline. This is updated  with  each  new
  588. X!      move.
  589. X  
  590. X       There are various buttons and cyclic  selections  available.
  591. X       Their  meanings are given below, plus an indication of their
  592. X***************
  593. X*** 54,62 ****
  594. X       other combination, then you should use the appropriate  com-
  595. X       mand line options (see below).
  596. X  
  597. X- REVE BUTTONS
  598. X-      With the graphics versions, there are eight buttons that are
  599. X-      normally  displayed  at  the top of the Reve window. Each of
  600. X  
  601. X  
  602. X  
  603. X--- 57,62 ----
  604. X***************
  605. X*** 71,81 ****
  606. X  
  607. X  
  608. X  
  609. X       these buttons, except  the  "done"  button  has  a  keyboard
  610. X       equivalent which is given in brackets below.
  611. X  
  612. X-      last [ l ]        Show the last move played.
  613. X- 
  614. X       load [ L ]        Load a game file. The format of this  game
  615. X                         file  is  given  below. With the graphical
  616. X                         versions,  a  text  field   is   displayed
  617. X--- 71,82 ----
  618. X  
  619. X  
  620. X  
  621. X+ REVE BUTTONS
  622. X+      With the graphics versions, there are eight buttons that are
  623. X+      normally  displayed  at  the top of the Reve window. Each of
  624. X       these buttons, except  the  "done"  button  has  a  keyboard
  625. X       equivalent which is given in brackets below.
  626. X  
  627. X       load [ L ]        Load a game file. The format of this  game
  628. X                         file  is  given  below. With the graphical
  629. X                         versions,  a  text  field   is   displayed
  630. X***************
  631. X*** 92,97 ****
  632. X--- 93,102 ----
  633. X                         game  file,  the piece is displayed on the
  634. X                         board, and the appropriate pieces flipped.
  635. X  
  636. X+      moves? [ A ]      Show all the valid moves for  the  current
  637. X+                        board.  This  is useful for beginners, and
  638. X+                        for teaching purposes.
  639. X+ 
  640. X       new game [ n ]    Start a new game of reve
  641. X  
  642. X       save [ S ]        Save the current game  to  file.  See  the
  643. X***************
  644. X*** 118,128 ****
  645. X       left mouse button, to increment  or  decrement  the  current
  646. X       selection  (depending  upon which half on the item you click
  647. X       over), or a selection can be made from a popup menu when you
  648. X-      click  with  the  right mouse button (SunView and XView ver-
  649. X-      sions only).  Each cycle value  has  a  keyboard  equivalent
  650. X-      which  is given in brackets below.  This must be followed by
  651. X-      the value of the new selection you wish to make.   The  dumb
  652. X-      tty  version  has the equivalent of these items displayed to
  653. X  
  654. X  
  655. X  
  656. X--- 123,128 ----
  657. X***************
  658. X*** 137,142 ****
  659. X--- 137,147 ----
  660. X  
  661. X  
  662. X  
  663. X+      click  with  the  right mouse button (SunView and XView ver-
  664. X+      sions only).  Each cycle value  has  a  keyboard  equivalent
  665. X+      which  is given in brackets below.  This must be followed by
  666. X+      the value of the new selection you wish to make.   The  dumb
  667. X+      tty  version  has the equivalent of these items displayed to
  668. X       the right of the reve board display.
  669. X  
  670. X       Black: [ B ]      Select whether the black player should  be
  671. X***************
  672. X*** 184,197 ****
  673. X            of  reve  it  is  possible  to give an optional display
  674. X            value.
  675. X  
  676. X-      -c   The computer will play. Presence or absence of  -b  and
  677. X-           -w options determine which piece the computer plays.
  678. X  
  679. X-      -d difficulty
  680. X-           The level of difficulty for  computer  moves.  See  the
  681. X  
  682. X  
  683. X- 
  684. X  Sun Release 4.1   Last change: 18 October 1990                  3
  685. X  
  686. X  
  687. X--- 189,197 ----
  688. X***************
  689. X*** 203,212 ****
  690. X  
  691. X  
  692. X  
  693. X            Difficulty:  cyclic  item  description  above  for more
  694. X            information.
  695. X  
  696. X!      -eedgefile
  697. X            Specify an alternate location for the reve edge stabil-
  698. X            ity  table  file. Normally the location of this file is
  699. X            compiled in when the program is created, but reve  will
  700. X--- 203,217 ----
  701. X  
  702. X  
  703. X  
  704. X+      -c   The computer will play. Presence or absence of  -b  and
  705. X+           -w options determine which piece the computer plays.
  706. X+ 
  707. X+      -d difficulty
  708. X+           The level of difficulty for  computer  moves.  See  the
  709. X            Difficulty:  cyclic  item  description  above  for more
  710. X            information.
  711. X  
  712. X!      -e edgefile
  713. X            Specify an alternate location for the reve edge stabil-
  714. X            ity  table  file. Normally the location of this file is
  715. X            compiled in when the program is created, but reve  will
  716. X***************
  717. X*** 226,233 ****
  718. X--- 231,245 ----
  719. X            Load a game file. The format of this game file is given
  720. X            below. The board will be setup with these pieces.
  721. X  
  722. X+      -m   Always display in monochrome, even on a color screen.
  723. X+ 
  724. X       -n   Display computer notes.
  725. X  
  726. X+      -r   Save a log of computer move  information  to  the  file
  727. X+           reve.res  as  the  game progresses. This information is
  728. X+           probably only useful to people trying  to  improve  the
  729. X+           computer algorithm.
  730. X+ 
  731. X       -?   Print the version number and  usage  message  for  this
  732. X            release of the reve program.
  733. X  
  734. X***************
  735. X*** 243,274 ****
  736. X            and  XView version of reve will automatically uses this
  737. X            flag, but the X11 version will also.
  738. X  
  739. X-      -Wp x y
  740. X-           Start the open window position at x y
  741. X  
  742. X-      -WP x y
  743. X-           Start the icon position at x y
  744. X  
  745. X- REVE GAMES FILE FORMAT
  746. X-      Reve has the ability to load or save games.  The  format  of
  747. X-      the games files are:
  748. X  
  749. X!           1,   <C-4>     -    [ remarks field ]
  750. X!           2,   -    <E-3>     [ remarks field ]
  751. X  
  752. X  
  753. X  
  754. X- Sun Release 4.1   Last change: 18 October 1990                  4
  755. X  
  756. X  
  757. X  
  758. X  
  759. X  
  760. X  
  761. X! REVE(6)                  GAMES AND DEMOS                  REVE(6)
  762. X  
  763. X  
  764. X  
  765. X       There is one move per line. Lines starting with  a  '#'  and
  766. X       blank lines are ignored. The first field of each line is the
  767. X       move number. This will be present before the  comma.  It  is
  768. X--- 255,287 ----
  769. X            and  XView version of reve will automatically uses this
  770. X            flag, but the X11 version will also.
  771. X  
  772. X  
  773. X  
  774. X  
  775. X! Sun Release 4.1   Last change: 18 October 1990                  4
  776. X  
  777. X  
  778. X  
  779. X  
  780. X  
  781. X  
  782. X+ REVE(6)                  GAMES AND DEMOS                  REVE(6)
  783. X  
  784. X  
  785. X  
  786. X!      -Wp x y
  787. X!           Start the open window position at x y
  788. X  
  789. X+      -WP x y
  790. X+           Start the icon position at x y
  791. X  
  792. X+ REVE GAMES FILE FORMAT
  793. X+      Reve has the ability to load or save games.  The  format  of
  794. X+      the games files are:
  795. X  
  796. X+           1,   <C-4>     -    [ remarks field ]
  797. X+           2,   -    <E-3>     [ remarks field ]
  798. X+ 
  799. X       There is one move per line. Lines starting with  a  '#'  and
  800. X       blank lines are ignored. The first field of each line is the
  801. X       move number. This will be present before the  comma.  It  is
  802. X***************
  803. X*** 297,315 ****
  804. X  AUTHORS
  805. X       Computer strategy:  Yves Gallot    galloty@cernvax.cern.ch
  806. X       Graphics interface: Rich Burridge  richb@Aus.Sun.COM
  807. X- 
  808. X- 
  809. X- 
  810. X- 
  811. X- 
  812. X- 
  813. X- 
  814. X- 
  815. X- 
  816. X- 
  817. X- 
  818. X- 
  819. X- 
  820. X  
  821. X  
  822. X  
  823. X--- 310,315 ----
  824. X
  825. X------- reve.6 -------
  826. X*** /tmp/da28768    Fri Nov  9 10:32:21 1990
  827. X--- reve.6    Fri Nov  9 10:31:13 1990
  828. X***************
  829. X*** 24,31 ****
  830. X--- 24,35 ----
  831. X  .B \-l
  832. X  .I gamefile
  833. X  ] [
  834. X+ .B \-m
  835. X+ ] [
  836. X  .B \-n
  837. X  ] [
  838. X+ .B \-r
  839. X+ ] [
  840. X  .B \-v
  841. X  ] [
  842. X  .B \-w
  843. X***************
  844. X*** 65,71 ****
  845. X  square in which you want your piece to go. Note that it is also possible
  846. X  to supply a number and a letter pair, to indicate where you would like your
  847. X  new piece to go. This is the only method to place pieces with the dumb tty
  848. X! interface.
  849. X  .LP
  850. X  There are various buttons and cyclic selections available. Their meanings
  851. X  are given below, plus an indication of their keyboard equivalents. With the
  852. X--- 69,76 ----
  853. X  square in which you want your piece to go. Note that it is also possible
  854. X  to supply a number and a letter pair, to indicate where you would like your
  855. X  new piece to go. This is the only method to place pieces with the dumb tty
  856. X! interface. The square containing the last move will be shown with a black
  857. X! outline. This is updated with each new move.
  858. X  .LP
  859. X  There are various buttons and cyclic selections available. Their meanings
  860. X  are given below, plus an indication of their keyboard equivalents. With the
  861. X***************
  862. X*** 83,90 ****
  863. X  displayed at the top of the Reve window. Each of these buttons, except
  864. X  the "done" button has a keyboard equivalent which is given in brackets below.
  865. X  .LP
  866. X- .IP "\fBlast [ l ]\fP" 18
  867. X- Show the last move played.
  868. X  .IP "\fBload [ L ]\fP" 18
  869. X  Load a game file. The format of this game file is given below. With the
  870. X  graphical versions, a text field is displayed between the \fBdone\fP and
  871. X--- 88,93 ----
  872. X***************
  873. X*** 95,100 ****
  874. X--- 98,106 ----
  875. X  stop on the invalid line, and display an error message. As each line is
  876. X  successfully read from the game file, the piece is displayed on the board,
  877. X  and the appropriate pieces flipped.
  878. X+ .IP "\fBmoves? [ A ]\fP" 18
  879. X+ Show all the valid moves for the current board. This is useful for beginners,
  880. X+ and for teaching purposes.
  881. X  .IP "\fBnew game [ n ]\fP" 18
  882. X  Start a new game of
  883. X  .I reve
  884. X***************
  885. X*** 178,184 ****
  886. X  The level of difficulty for computer moves. See the \fBDifficulty:\fP
  887. X  cyclic item description above for more information.
  888. X  .TP
  889. X! .BI \-e "edgefile"
  890. X  Specify an alternate location for the
  891. X  .I reve
  892. X  edge stability table file. Normally the location of this file is compiled
  893. X--- 184,190 ----
  894. X  The level of difficulty for computer moves. See the \fBDifficulty:\fP
  895. X  cyclic item description above for more information.
  896. X  .TP
  897. X! .BI \-e " edgefile"
  898. X  Specify an alternate location for the
  899. X  .I reve
  900. X  edge stability table file. Normally the location of this file is compiled
  901. X***************
  902. X*** 201,208 ****
  903. X--- 207,223 ----
  904. X  Load a game file. The format of this game file is given below. The board
  905. X  will be setup with these pieces.
  906. X  .TP
  907. X+ .B \-m
  908. X+ Always display in monochrome, even on a color screen.
  909. X+ .TP
  910. X  .B \-n
  911. X  Display computer notes.
  912. X+ .TP
  913. X+ .B \-r
  914. X+ Save a log of computer move information to the file
  915. X+ .I reve.res
  916. X+ as the game progresses. This information is probably only useful to
  917. X+ people trying to improve the computer algorithm.
  918. X  .TP
  919. X  .B \-?
  920. X  Print the version number and usage message for this release of the
  921. X
  922. X------- main.c -------
  923. X*** /tmp/da28803    Fri Nov  9 10:34:47 1990
  924. X--- main.c    Wed Nov  7 15:04:18 1990
  925. X***************
  926. X*** 6,16 ****
  927. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  928. X   *  All rights reserved.
  929. X   *
  930. X!  *  Permission is given to distribute these sources, as long as the
  931. X!  *  introductory messages are not removed, and no monies are exchanged.
  932. X   *
  933. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  934. X!  *  any tournaments, without the permission of the authors.
  935. X   *
  936. X   *  No responsibility is taken for any errors on inaccuracies inherent
  937. X   *  either to the comments or the code of this program, but if reported
  938. X--- 6,21 ----
  939. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  940. X   *  All rights reserved.
  941. X   *
  942. X!  *  Permission is granted to copy this source, for redistribution
  943. X!  *  in source form only, provided the news headers in "substantially
  944. X!  *  unaltered format" are retained, the introductory messages are not
  945. X!  *  removed, and no monies are exchanged.
  946. X   *
  947. X!  *  Permission is also granted to copy this source, without the
  948. X!  *  news headers, for the purposes of making an executable copy by
  949. X!  *  means of compilation, provided that such copy will not be used
  950. X!  *  for the purposes of competition in any othello tournaments, without
  951. X!  *  prior permission from the authors.
  952. X   *
  953. X   *  No responsibility is taken for any errors on inaccuracies inherent
  954. X   *  either to the comments or the code of this program, but if reported
  955. X***************
  956. X*** 17,28 ****
  957. X   *  (see README file), then an attempt will be made to fix them.
  958. X   */
  959. X  
  960. X- #include <stdio.h>
  961. X- #include <strings.h>
  962. X- #include <sys/time.h>
  963. X- #include "color.h"
  964. X  #include "reve.h"
  965. X  #include "patchlevel.h"
  966. X  
  967. X  /* Text values for the cyclic buttons. */
  968. X  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  969. X--- 22,39 ----
  970. X   *  (see README file), then an attempt will be made to fix them.
  971. X   */
  972. X  
  973. X  #include "reve.h"
  974. X+ #include "color.h"
  975. X  #include "patchlevel.h"
  976. X+ #ifdef SYSV
  977. X+ #include <string.h>
  978. X+ #else
  979. X+ #include <strings.h>
  980. X+ #endif /*SYSV*/
  981. X+ #include <sys/time.h>
  982. X+ #ifdef X11
  983. X+ #include <X11/Xos.h>
  984. X+ #endif /*X11*/
  985. X  
  986. X  /* Text values for the cyclic buttons. */
  987. X  char *diff_values[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL } ;
  988. X***************
  989. X*** 45,51 ****
  990. X  int cur_ch ;            /* Current character pressed. */
  991. X  int curx ;              /* Current mouse X position. */
  992. X  int cury ;              /* Current mouse Y position. */
  993. X- int depth ;             /* Depth of search for computers move. */
  994. X  int down ;              /* Indicates is a mouse button is down. */
  995. X  int first_move = 0 ;    /* Set if computer plays first move. */
  996. X  int iconic ;            /* Set if window is currently iconic. */
  997. X--- 56,61 ----
  998. X***************
  999. X*** 58,65 ****
  1000. X--- 68,77 ----
  1001. X  int ix ;                /* Initial X position of the icon. */
  1002. X  int iy ;                /* Initial Y position of the icon. */
  1003. X  int last_move ;         /* Last valid computer move. */
  1004. X+ int level ;             /* Current level of difficulty for computer moves. */
  1005. X  int loadgame = 0 ;      /* Set if there is a game file to load. */
  1006. X  int lsval = 0 ;         /* Set to 'l' or 's', if loading or saving. */
  1007. X+ int monochrome = 0 ;    /* If set, display will be in monochrome. */
  1008. X  int move ;              /* Current move being evaluated. */
  1009. X  int move_delta ;        /* Delta for piece animation. */
  1010. X  int nextc ;             /* Current event identifier. */
  1011. X***************
  1012. X*** 67,72 ****
  1013. X--- 79,86 ----
  1014. X  int nfont_height ;      /* Height in pixels for normal font. */
  1015. X  int play_computer ;     /* Set if playing against the computer. */
  1016. X  int posspec ;           /* Set if -Wp or -g option is present (for X11) */
  1017. X+ int saveres = 0 ;       /* If set, save computer results to log file. */
  1018. X+ int show_moves = 0 ;    /* If set, all possible moves are being shown. */
  1019. X  int show_notes ;        /* If set, display notes value from play_reve. */
  1020. X  int suggestion = -1 ;   /* Positive if a suggested move. */
  1021. X  int suggest_x ;         /* X position of suggested move. */
  1022. X***************
  1023. X*** 93,98 ****
  1024. X--- 107,113 ----
  1025. X  BOARD old_board ;          /* The previous reve board. */
  1026. X  BOARD board ;              /* The current reve board. */
  1027. X  BOARD *s_pos ;
  1028. X+ BOARD s_all ;              /* List of valid positions for this move. */
  1029. X  
  1030. X  BOARD moves[64] ;          /* Complete array of board moves. */
  1031. X  
  1032. X***************
  1033. X*** 101,110 ****
  1034. X  /*   type   x   y   width   height   text   value   function */
  1035. X  
  1036. X  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1037. X!              BWIDTH, BHEIGHT, "last",     0, last },
  1038. X  
  1039. X  { P_BUTTON,  BBORDER + (1*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1040. X!              BWIDTH, BHEIGHT, "load",     0, draw_textfield },
  1041. X  
  1042. X  { P_BUTTON,  BBORDER + (2*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1043. X               BWIDTH, BHEIGHT, "new game", 0, new_game },
  1044. X--- 116,125 ----
  1045. X  /*   type   x   y   width   height   text   value   function */
  1046. X  
  1047. X  { P_BUTTON,  BBORDER + (0*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1048. X!              BWIDTH, BHEIGHT, "load",     0, draw_textfield },
  1049. X  
  1050. X  { P_BUTTON,  BBORDER + (1*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1051. X!              BWIDTH, BHEIGHT, "moves?",   0, show_all_moves },
  1052. X  
  1053. X  { P_BUTTON,  BBORDER + (2*(BWIDTH+BGAP)), BBORDER + (0*(BHEIGHT+BGAP)),
  1054. X               BWIDTH, BHEIGHT, "new game", 0, new_game },
  1055. X***************
  1056. X*** 170,175 ****
  1057. X--- 185,191 ----
  1058. X  long c1, c2, c3 ;            /* Constants used in evaluation function */
  1059. X  long edges[6561] ;           /* Edges Stability Table */
  1060. X  long note ;                  /* Note value for current computer move. */
  1061. X+ time_t timeleft ;            /* Amount of time left for computer moves. */
  1062. X  
  1063. X  extern enum gr_type gtype ;                     /* Graphics type. */ 
  1064. X  
  1065. X***************
  1066. X*** 190,195 ****
  1067. X--- 206,226 ----
  1068. X        FPRINTF(stderr,"Error initialising window system.\n") ;
  1069. X        exit(1) ;
  1070. X      }
  1071. X+   generate_graphics(argc, argv, DPY1) ;
  1072. X+   if (dtype == XTWO) generate_graphics(argc, argv, DPY2) ;
  1073. X+   start_tool(dtype) ;           /* Event handling loop. */
  1074. X+   exit(0) ;
  1075. X+ /*NOTREACHED*/
  1076. X+ }
  1077. X+ 
  1078. X+ 
  1079. X+ void
  1080. X+ generate_graphics(argc, argv, dpyno)
  1081. X+ enum dpy_type dpyno ;
  1082. X+ int argc ;
  1083. X+ char *argv[] ;
  1084. X+ {
  1085. X+   cur_dpyno = dpyno ;
  1086. X    make_icon() ;
  1087. X    make_frame(argc, argv) ;      /* Create reve window/icon. */
  1088. X    make_canvas() ;               /* Create drawing canvas. */
  1089. X***************
  1090. X*** 200,208 ****
  1091. X    create_menu(NOTES,       notes_values) ;
  1092. X    initboard() ;
  1093. X    set_cursor(CANVASCUR) ;
  1094. X-   start_tool(dtype) ;           /* Event handling loop. */
  1095. X-   exit(0) ;
  1096. X- /*NOTREACHED*/
  1097. X  }
  1098. X  
  1099. X  
  1100. X--- 231,236 ----
  1101. X***************
  1102. X*** 212,217 ****
  1103. X--- 240,246 ----
  1104. X  char *argv[] ;
  1105. X  {
  1106. X    char next[MAXLINE] ;    /* The next command line parameter. */
  1107. X+   int i ;
  1108. X  
  1109. X    INC ;
  1110. X    while (argc > 0)
  1111. X***************
  1112. X*** 220,226 ****
  1113. X          switch (argv[0][1])
  1114. X            {
  1115. X              case 'b' : isblack = 1 ;
  1116. X!                        if (*argv != NULL && argv[0][0] != '-')
  1117. X                           {
  1118. X                             INC ;
  1119. X                             black_dpy = *argv ;
  1120. X--- 249,255 ----
  1121. X          switch (argv[0][1])
  1122. X            {
  1123. X              case 'b' : isblack = 1 ;
  1124. X!                        if (*(argv+1) != NULL && argv[1][0] != '-')
  1125. X                           {
  1126. X                             INC ;
  1127. X                             black_dpy = *argv ;
  1128. X***************
  1129. X*** 230,238 ****
  1130. X                         break ;
  1131. X              case 'd' : INC ;
  1132. X                         getparam(next, argv, "-d needs difficulty") ;
  1133. X!                        depth = atoi(next) ;
  1134. X!                        if (depth < 1 || depth > MAXDIFF) depth = INIT_DEPTH ;
  1135. X!                        items[(int) DIFFICULTY].value = depth - 1 ;
  1136. X                         break ;
  1137. X              case 'e' : INC ;
  1138. X                         getparam(edgefile, argv, "-e needs an edgetable file") ;
  1139. X--- 259,267 ----
  1140. X                         break ;
  1141. X              case 'd' : INC ;
  1142. X                         getparam(next, argv, "-d needs difficulty") ;
  1143. X!                        level = atoi(next) ;
  1144. X!                        if (level < 1 || level > MAXDIFF) level = INIT_DEPTH ;
  1145. X!                        items[(int) DIFFICULTY].value = level - 1 ;
  1146. X                         break ;
  1147. X              case 'e' : INC ;
  1148. X                         getparam(edgefile, argv, "-e needs an edgetable file") ;
  1149. X***************
  1150. X*** 247,260 ****
  1151. X                         getparam(gamefile, argv, "-l needs a game file") ;
  1152. X                         loadgame = 1 ;        /* Game file to load. */
  1153. X                         break ;
  1154. X              case 'n' : show_notes = 1 ;      /* Display computer notes. */
  1155. X                         items[(int) NOTES].value = 1 ;
  1156. X                         break ;
  1157. X              case '?' :
  1158. X              case 'v' : usage() ;
  1159. X  
  1160. X              case 'w' : iswhite = 1 ;
  1161. X!                        if (*argv != NULL && argv[0][0] != '-')
  1162. X                           {
  1163. X                             INC ;
  1164. X                             white_dpy = *argv ;
  1165. X--- 276,294 ----
  1166. X                         getparam(gamefile, argv, "-l needs a game file") ;
  1167. X                         loadgame = 1 ;        /* Game file to load. */
  1168. X                         break ;
  1169. X+             case 'm' : monochrome = 1 ;      /* Force display to mono. */
  1170. X+                        for (i = 0; i < MAXDPY; i++) iscolor[i] = 0 ;
  1171. X+                        break ;
  1172. X              case 'n' : show_notes = 1 ;      /* Display computer notes. */
  1173. X                         items[(int) NOTES].value = 1 ;
  1174. X                         break ;
  1175. X+             case 'r' : saveres = 1 ;       /* Save computer results to file. */
  1176. X+                        break ;
  1177. X              case '?' :
  1178. X              case 'v' : usage() ;
  1179. X  
  1180. X              case 'w' : iswhite = 1 ;
  1181. X!                        if (*(argv+1) != NULL && argv[1][0] != '-')
  1182. X                           {
  1183. X                             INC ;
  1184. X                             white_dpy = *argv ;
  1185. X***************
  1186. X*** 382,387 ****
  1187. X--- 416,422 ----
  1188. X                  BFONT, color, sa) ;
  1189. X      }
  1190. X    batch(IS_OFF) ;
  1191. X+   show_last(last_move, IS_ON) ;
  1192. X    show_suggestion() ;
  1193. X    batch(IS_ON) ;
  1194. X    FOR_BOARD(i)
  1195. X***************
  1196. X*** 423,430 ****
  1197. X    show_notes    = FALSE ;
  1198. X    isblack       = 0 ;
  1199. X    iswhite       = 0 ;
  1200. X!   depth         = INIT_DEPTH ;
  1201. X!   items[(int) DIFFICULTY].value = depth - 1 ;
  1202. X  
  1203. X    black_dpy = NULL ;              /* X11 black piece display information. */
  1204. X    white_dpy = NULL ;              /* X11 white piece display information. */
  1205. X--- 458,465 ----
  1206. X    show_notes    = FALSE ;
  1207. X    isblack       = 0 ;
  1208. X    iswhite       = 0 ;
  1209. X!   level         = INIT_DEPTH ;
  1210. X!   items[(int) DIFFICULTY].value = level - 1 ;
  1211. X  
  1212. X    black_dpy = NULL ;              /* X11 black piece display information. */
  1213. X    white_dpy = NULL ;              /* X11 white piece display information. */
  1214. X***************
  1215. X*** 512,517 ****
  1216. X--- 547,553 ----
  1217. X  void
  1218. X  set_display_types()
  1219. X  {
  1220. X+        if (isblack && iswhite) play_computer = 0 ;
  1221. X         if (isblack && iswhite) dtype = XBOTH ;
  1222. X    else if (isblack)            dtype = XBLACK ;
  1223. X    else if (iswhite)            dtype = XWHITE ;
  1224. X***************
  1225. X*** 553,559 ****
  1226. X  int player ;
  1227. X  {
  1228. X    set_cursor(HOURGLASS) ;
  1229. X!   play_reve(board.square, player, depth, &move, ¬e) ;
  1230. X    set_cursor(CANVASCUR) ;
  1231. X    animate_move(move) ;
  1232. X    do_move(player) ;
  1233. X--- 589,596 ----
  1234. X  int player ;
  1235. X  {
  1236. X    set_cursor(HOURGLASS) ;
  1237. X!   move = TRUE ;            /* Make sure the computer clock is decremented. */
  1238. X!   play_reve(board.square, player, level, &move, ¬e) ;
  1239. X    set_cursor(CANVASCUR) ;
  1240. X    animate_move(move) ;
  1241. X    do_move(player) ;
  1242. X
  1243. X------- makemove.c -------
  1244. X*** /tmp/da28806    Fri Nov  9 10:34:48 1990
  1245. X--- makemove.c    Mon Nov  5 09:06:03 1990
  1246. X***************
  1247. X*** 7,17 ****
  1248. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  1249. X   *  All rights reserved.
  1250. X   *
  1251. X!  *  Permission is given to distribute these sources, as long as the
  1252. X!  *  introductory messages are not removed, and no monies are exchanged.
  1253. X   *
  1254. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  1255. X!  *  any tournaments, without the permission of the authors.
  1256. X   *
  1257. X   *  No responsibility is taken for any errors on inaccuracies inherent
  1258. X   *  either to the comments or the code of this program, but if reported
  1259. X--- 7,22 ----
  1260. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  1261. X   *  All rights reserved.
  1262. X   *
  1263. X!  *  Permission is granted to copy this source, for redistribution
  1264. X!  *  in source form only, provided the news headers in "substantially
  1265. X!  *  unaltered format" are retained, the introductory messages are not
  1266. X!  *  removed, and no monies are exchanged.
  1267. X   *
  1268. X!  *  Permission is also granted to copy this source, without the
  1269. X!  *  news headers, for the purposes of making an executable copy by
  1270. X!  *  means of compilation, provided that such copy will not be used
  1271. X!  *  for the purposes of competition in any othello tournaments, without
  1272. X!  *  prior permission from the authors.
  1273. X   *
  1274. X   *  No responsibility is taken for any errors on inaccuracies inherent
  1275. X   *  either to the comments or the code of this program, but if reported
  1276. X***************
  1277. X*** 18,24 ****
  1278. X   *  (see README file), then an attempt will be made to fix them.
  1279. X   */
  1280. X  
  1281. X- #include <stdio.h>
  1282. X  #include "reve.h"
  1283. X  #include "extern.h"
  1284. X  
  1285. X--- 23,28 ----
  1286. X***************
  1287. X*** 101,106 ****
  1288. X--- 105,111 ----
  1289. X    register int square,offset ;
  1290. X    int row_offset,col_offset,piece,piece_count ;
  1291. X  
  1292. X+   if ((s_move+increment) < 0 || (s_move+increment) > 63) return(FALSE) ;
  1293. X    if (s_pos->square[s_move+increment] != s_opponent) return(FALSE) ;
  1294. X   
  1295. X  /*  Quick test to catch most failures -
  1296. X
  1297. X------- procs.c -------
  1298. X*** /tmp/da28809    Fri Nov  9 10:34:49 1990
  1299. X--- procs.c    Thu Nov  8 10:46:31 1990
  1300. X***************
  1301. X*** 7,17 ****
  1302. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  1303. X   *  All rights reserved.
  1304. X   *
  1305. X!  *  Permission is given to distribute these sources, as long as the
  1306. X!  *  introductory messages are not removed, and no monies are exchanged.
  1307. X   *
  1308. X!  *  You are forbidden from using Reve as is, or in a modified state, in
  1309. X!  *  any tournaments, without the permission of the authors.
  1310. X   *
  1311. X   *  No responsibility is taken for any errors on inaccuracies inherent
  1312. X   *  either to the comments or the code of this program, but if reported
  1313. X--- 7,22 ----
  1314. X   *  Copyright (C) 1990 - Rich Burridge & Yves Gallot.
  1315. X   *  All rights reserved.
  1316. X   *
  1317. X!  *  Permission is granted to copy this source, for redistribution
  1318. X!  *  in source form only, provided the news headers in "substantially
  1319. X!  *  unaltered format" are retained, the introductory messages are not
  1320. X!  *  removed, and no monies are exchanged.
  1321. X   *
  1322. X!  *  Permission is also granted to copy this source, without the
  1323. X!  *  news headers, for the purposes of making an executable copy by
  1324. X!  *  means of compilation, provided that such copy will not be used
  1325. X!  *  for the purposes of competition in any othello tournaments, without
  1326. X!  *  prior permission from the authors.
  1327. X   *
  1328. X   *  No responsibility is taken for any errors on inaccuracies inherent
  1329. X   *  either to the comments or the code of this program, but if reported
  1330. X***************
  1331. X*** 18,24 ****
  1332. X   *  (see README file), then an attempt will be made to fix them.
  1333. X   */
  1334. X  
  1335. X- #include <stdio.h>
  1336. X  #include "color.h"
  1337. X  #include "reve.h"
  1338. X  #include "extern.h"
  1339. X--- 23,28 ----
  1340. X***************
  1341. X*** 27,33 ****
  1342. X  void
  1343. X  difficulty()
  1344. X  {
  1345. X!   depth = next_setting(DIFFICULTY, diff_values) + 1 ;
  1346. X  }
  1347. X  
  1348. X  
  1349. X--- 31,37 ----
  1350. X  void
  1351. X  difficulty()
  1352. X  {
  1353. X!   level = next_setting(DIFFICULTY, diff_values) + 1 ;
  1354. X  }
  1355. X  
  1356. X  
  1357. X***************
  1358. X*** 46,53 ****
  1359. X    else
  1360. X      {
  1361. X        draw_piece(next_player, piece_x, piece_y, RINV) ;
  1362. X!       cx = (piece_x + PIECE_RAD) / CELL_SIZE ;
  1363. X!       cy = ((piece_y - CY) + PIECE_RAD) / CELL_SIZE ;
  1364. X        move = cy * BOARD_SIZE + cx ;
  1365. X        make_move() ;
  1366. X      }
  1367. X--- 50,57 ----
  1368. X    else
  1369. X      {
  1370. X        draw_piece(next_player, piece_x, piece_y, RINV) ;
  1371. X!       cx = (piece_x + PIECE_RAD - BBORDER) / CELL_SIZE ;
  1372. X!       cy = (piece_y + PIECE_RAD - CY - BBORDER) / CELL_SIZE ;
  1373. X        move = cy * BOARD_SIZE + cx ;
  1374. X        make_move() ;
  1375. X      }
  1376. X***************
  1377. X*** 66,72 ****
  1378. X  init_notes()
  1379. X  {
  1380. X    show_notes = next_setting(NOTES, notes_values) ;
  1381. X!   if (show_notes == FALSE) message(NOTES_MES, "") ;
  1382. X  }
  1383. X  
  1384. X  
  1385. X--- 70,76 ----
  1386. X  init_notes()
  1387. X  {
  1388. X    show_notes = next_setting(NOTES, notes_values) ;
  1389. X!   if (show_notes == FALSE) message(EVAL_MES, "") ;
  1390. X  }
  1391. X  
  1392. X  
  1393. X***************
  1394. X*** 102,110 ****
  1395. X        message(PANEL_MES, "Computer can't play both players.") ;
  1396. X      }
  1397. X    if (curi == HUMAN    && curo == COMPUTER)
  1398. X!     dtype = (next_player == BLACK) ? XBLACK : XWHITE ;
  1399. X    else if (curi == COMPUTER && curo == HUMAN)
  1400. X!     dtype = (next_player == BLACK) ? XWHITE : XBLACK ;
  1401. X    else if (curi == HUMAN    && curo == HUMAN)
  1402. X      dtype = (dtype == XTWO) ? XTWO : XBOTH ; 
  1403. X  
  1404. X--- 106,114 ----
  1405. X        message(PANEL_MES, "Computer can't play both players.") ;
  1406. X      }
  1407. X    if (curi == HUMAN    && curo == COMPUTER)
  1408. X!     dtype = (item == BLACK_PLAYS) ? XBLACK : XWHITE ;
  1409. X    else if (curi == COMPUTER && curo == HUMAN)
  1410. X!     dtype = (item == BLACK_PLAYS) ? XWHITE : XBLACK ;
  1411. X    else if (curi == HUMAN    && curo == HUMAN)
  1412. X      dtype = (dtype == XTWO) ? XTWO : XBOTH ; 
  1413. X  
  1414. X***************
  1415. X*** 116,139 ****
  1416. X  
  1417. X  
  1418. X  void
  1419. X- last()
  1420. X- {
  1421. X-   enum optype rop ;
  1422. X-   int flips, player, x, y ;
  1423. X- 
  1424. X-   if (last_move == -1) return ;        /* No last move. */
  1425. X-   player = board.square[last_move] ;
  1426. X-   for (flips = 0; flips < 4; flips++)
  1427. X-     {
  1428. X-       get_xy(last_move, &x, &y) ;
  1429. X-       rop = flips % 2 ? RSRC : RCLR ;
  1430. X-       draw_piece(player, x, CY+y, rop) ;
  1431. X-       PAUSE ;
  1432. X-     }
  1433. X- }
  1434. X- 
  1435. X- 
  1436. X- void
  1437. X  make_move()
  1438. X  {
  1439. X    if (legal(move, next_player, &board) == FALSE)
  1440. X--- 120,125 ----
  1441. X***************
  1442. X*** 149,160 ****
  1443. X        case XBLACK :
  1444. X        case XWHITE : computer_move(OPPONENT(next_player)) ;
  1445. X                      return ;
  1446. X!       case XBOTH  : if (check(next_player) == TRUE) break ;
  1447. X                      (void) check(OPPONENT(next_player)) ;
  1448. X                      return ;
  1449. X-       case XTWO   : FPRINTF(stderr, "Multi display not supported yet.\n") ;
  1450. X      }
  1451. X- 
  1452. X    cmode = (enum cantype) (OPPONENT(next_player) + 1) ;
  1453. X    next_player = OPPONENT(next_player) ;
  1454. X  }
  1455. X--- 135,145 ----
  1456. X        case XBLACK :
  1457. X        case XWHITE : computer_move(OPPONENT(next_player)) ;
  1458. X                      return ;
  1459. X!       case XBOTH  :
  1460. X!       case XTWO   : if (check(next_player) == TRUE) break ;
  1461. X                      (void) check(OPPONENT(next_player)) ;
  1462. X                      return ;
  1463. X      }
  1464. X    cmode = (enum cantype) (OPPONENT(next_player) + 1) ;
  1465. X    next_player = OPPONENT(next_player) ;
  1466. X  }
  1467. X***************
  1468. X*** 168,174 ****
  1469. X    last_move = -1 ;
  1470. X    if (items[(int) BLACK_PLAYS].value == COMPUTER) first_move = 1 ;
  1471. X    init_canvas() ;
  1472. X!   message(NOTES_MES, "") ;
  1473. X    message(PANEL_MES, "Use left mouse button to move") ;
  1474. X    draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
  1475. X  }
  1476. X--- 153,159 ----
  1477. X    last_move = -1 ;
  1478. X    if (items[(int) BLACK_PLAYS].value == COMPUTER) first_move = 1 ;
  1479. X    init_canvas() ;
  1480. X!   message(EVAL_MES, "") ;
  1481. X    message(PANEL_MES, "Use left mouse button to move") ;
  1482. X    draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
  1483. X  }
  1484. X***************
  1485. X*** 208,213 ****
  1486. X--- 193,206 ----
  1487. X  
  1488. X  
  1489. X  void
  1490. X+ show_all_moves()
  1491. X+ {
  1492. X+   if (show_moves) show_all(IS_OFF) ;
  1493. X+   else            show_all(IS_ON) ;
  1494. X+ }
  1495. X+ 
  1496. X+ 
  1497. X+ void
  1498. X  suggest()
  1499. X  {
  1500. X    int player ;
  1501. X***************
  1502. X*** 216,222 ****
  1503. X    if (cmode == GAME_OVER) return ;
  1504. X    if (cmode == WHITE_START) player = WHITE ;
  1505. X    else                      player = BLACK ;
  1506. X!   play_reve(&board.square[0], player, depth, &suggestion, ¬e) ;
  1507. X  
  1508. X    suggest_x = BBORDER + ((suggestion & 7)  + 1) * CELL_SIZE - CELL_SIZE / 2 ;
  1509. X    suggest_y = BBORDER + ((suggestion >> 3) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
  1510. X--- 209,216 ----
  1511. X    if (cmode == GAME_OVER) return ;
  1512. X    if (cmode == WHITE_START) player = WHITE ;
  1513. X    else                      player = BLACK ;
  1514. X!   suggestion = FALSE ;   /* Make sure the computer clock isn't decremented. */
  1515. X!   play_reve(&board.square[0], player, level, &suggestion, ¬e) ;
  1516. X  
  1517. X    suggest_x = BBORDER + ((suggestion & 7)  + 1) * CELL_SIZE - CELL_SIZE / 2 ;
  1518. X    suggest_y = BBORDER + ((suggestion >> 3) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
  1519. X***************
  1520. X*** 259,269 ****
  1521. X--- 253,266 ----
  1522. X  
  1523. X    if (n >= 3)
  1524. X      {
  1525. X+       show_last(last_move, IS_OFF) ;
  1526. X        FOR_BOARD(i) board.square[i] = moves[n].square[i] ;
  1527. X        board.moves_left = moves[n].moves_left ;
  1528. X        board.player     = moves[n].player ;
  1529. X        board.move       = moves[n].move ;
  1530. X        board.note       = moves[n].note ;
  1531. X+       board.timeleft   = moves[n].timeleft ;
  1532. X+       last_move        = board.move ;
  1533. X        moves[n+1].move  = -1 ;
  1534. X  
  1535. X        FOR_BOARD(i) old_board.square[i] = moves[n-1].square[i] ;
  1536. X***************
  1537. X*** 271,277 ****
  1538. X--- 268,277 ----
  1539. X        old_board.player     = moves[n-1].player ;
  1540. X        old_board.move       = moves[n-1].move ;
  1541. X        old_board.note       = moves[n-1].note ;
  1542. X+       old_board.timeleft   = moves[n-1].timeleft ;
  1543. X  
  1544. X+       timeleft = board.timeleft ;
  1545. X+ 
  1546. X        if (OPPONENT(player) == BLACK) cmode = BLACK_START ;
  1547. X        else                           cmode = WHITE_START ;
  1548. X        message(PANEL_MES, "") ;
  1549. X***************
  1550. X*** 284,289 ****
  1551. X--- 284,290 ----
  1552. X                         (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
  1553. X            else draw_piece(board.square[i], x, CY+y, RSRC) ;
  1554. X          }
  1555. X+       if (n > 3) show_last(last_move, IS_ON) ;
  1556. X        next_player = OPPONENT(board.player) ;
  1557. X      }
  1558. X    else message(PANEL_MES, "No moves to undo.") ;
  1559. X
  1560. X
  1561. END_OF_FILE
  1562. if test 51889 -ne `wc -c <'patches01b'`; then
  1563.     echo shar: \"'patches01b'\" unpacked with wrong size!
  1564. fi
  1565. # end of 'patches01b'
  1566. fi
  1567. echo shar: End of archive 2 \(of 4\).
  1568. cp /dev/null ark2isdone
  1569. MISSING=""
  1570. for I in 1 2 3 4 ; do
  1571.     if test ! -f ark${I}isdone ; then
  1572.     MISSING="${MISSING} ${I}"
  1573.     fi
  1574. done
  1575. if test "${MISSING}" = "" ; then
  1576.     echo You have unpacked all 4 archives.
  1577.     rm -f ark[1-9]isdone
  1578. else
  1579.     echo You still need to unpack the following archives:
  1580.     echo "        " ${MISSING}
  1581. fi
  1582. ##  End of shell archive.
  1583. exit 0
  1584.