home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / xstratgo / part02 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  56.9 KB

  1. Path: uunet!ogicse!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v15i012:  xstratego - X Windows stratego interface for two players, Part02/04
  5. Message-ID: <3817@master.CNA.TEK.COM>
  6. Date: 26 Oct 92 23:52:10 GMT
  7. Article-I.D.: master.3817
  8. Sender: news@master.CNA.TEK.COM
  9. Lines: 1771
  10. Approved: billr@saab.CNA.TEK.COM
  11. Xref: uunet comp.sources.games:1511
  12.  
  13. Submitted-by: Henk-Jan Visscher <hjvissc@cs.vu.nl>
  14. Posting-number: Volume 15, Issue 12
  15. Archive-name: xstratego/Part02
  16. Environment: X11, Xaw
  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:  Imakefile buzz.c callback.c icons/captain_mask.h
  28. #   icons/colonel_mask.h icons/enemy_mask.h icons/general_mask.h
  29. #   icons/lieutenant.h icons/lieutenant_mask.h icons/major_mask.h
  30. #   icons/marshal_mask.h icons/miner_mask.h icons/scout_mask.h
  31. #   icons/sergeant_mask.h init.c message.c register.c socket.c
  32. #   stratego.h
  33. # Wrapped by billr@saab on Mon Oct 26 15:47:07 1992
  34. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  35. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  36.   echo shar: Will not clobber existing file \"'Imakefile'\"
  37. else
  38. echo shar: Extracting \"'Imakefile'\" \(280 characters\)
  39. sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  40. XLOCAL_LIBRARIES = XawClientLibs
  41. X    DEPLIBS = XawClientDepLibs
  42. X
  43. XSRCS = buzz.c callback.c dialog.c init.c main.c message.c play.c register.c setup.c socket.c
  44. XOBJS = buzz.o callback.o dialog.o init.o main.o message.o play.o register.o setup.o socket.o
  45. X
  46. XComplexProgramTarget(xstratego)
  47. END_OF_FILE
  48. if test 280 -ne `wc -c <'Imakefile'`; then
  49.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  50. fi
  51. # end of 'Imakefile'
  52. fi
  53. if test -f 'buzz.c' -a "${1}" != "-c" ; then 
  54.   echo shar: Will not clobber existing file \"'buzz.c'\"
  55. else
  56. echo shar: Extracting \"'buzz.c'\" \(6956 characters\)
  57. sed "s/^X//" >'buzz.c' <<'END_OF_FILE'
  58. X/*
  59. X * "buzz.c"
  60. X */
  61. X
  62. X#include "buzz.h"
  63. X
  64. X#define        NIL_CHAR    ((char *) 0)
  65. X#define     MEND        {NIL_CHAR, 101}    /* table closer */
  66. X
  67. XMESSAGE    move_opponent [] = {        /* moving enemy piece */
  68. X    {"Sorry, no response!", 100},
  69. X    {"The Bomb turns around and says: \"I should have blown you to bits\"",
  70. X        10},
  71. X    {"The Marshall turns around and says: \"Burp!\"", 10},
  72. X    {"The enemy piece turns around and says: \"Hands off\"", 50},
  73. X    {"The enemy piece turns around and says: \"Ok, I'll help you.  \
  74. XWhat's it worth?\"", 50},
  75. X    {"The enemy piece turns around and says: \"Go away thy fiend!\"", 50},
  76. X    {"The Spy turns around and says: \"Clever!  How did you find out?\"",
  77. X        10},
  78. X    {"The enemy piece turns around and says: \"Stick to your own\"", 50},
  79. X    {"C'mon that's no way to win.", 100},
  80. X    {"I think you're playing the other color.", 100},
  81. X    {"Boom!!!  It turned out to be a Bomb!", 50},
  82. X    {"Move yer own, will ya..", 100},
  83. X    {"The General won't answer.", 10},
  84. X    {"The Scout won't answer.", 10},
  85. X    {"The Bomb won't answer.", 10},
  86. X    {"Try again.  He might give himself away.", 100},
  87. X    {"Don't, your opponent is watching.", 100},
  88. X    {"It seems to speak a different language.", 100},
  89. X    {"Your opponent won't agree.", 100},
  90. X    {"Ask the other player.", 100},
  91. X    MEND
  92. X};
  93. X
  94. XMESSAGE    move_empty [] = {        /* trying to move empty location */
  95. X     {"There is nothing there!", 100},
  96. X    {"You thought someone dug a hole here?", 100},
  97. X    {"He moved out.", 100},
  98. X    {"You start digging...", 100},
  99. X    {"You continue digging...", 50},
  100. X    {"The ground is to hard to dig into.", 50},
  101. X    {"You dug a pit.", 50},
  102. X    {"Vell, vell.  Und vere's all zat void going, hah?", 50},
  103. X    {"Don't use innocent civilians, dirtbag!", 50},
  104. X    {"Trying to dig up a corpse are ya?", 50},
  105. X    MEND
  106. X};
  107. X
  108. XMESSAGE    move_flag [] = {        /* flag movement */
  109. X    {"But it hasn't got any legs!", 100},
  110. X    {"It seems to be stuck.", 100},
  111. X    {"With enormous effort, you move the flag.", 50},
  112. X    {"No no, read page 546, paragraph 93a of the manual.", 100},
  113. X    {"Get somebody to help.", 50},
  114. X    {"Its no use, your going to lose anyway.", 50},
  115. X    {"I wouldn't try to attack anything with it.", 100},
  116. X    {"It's surrounded by bombs!", 50},
  117. X    {"Leider zis here fahn von't move.", 50},
  118. X    MEND
  119. X};
  120. X
  121. XMESSAGE    move_bomb [] = {        /* bomb movement */
  122. X    {"Don't muck about with explosives. You might get your head blown off.",        100},
  123. X    {"Ask an enemy miner to help you.", 100},
  124. X    {"That's a ball.  Try kicking it.", 100},
  125. X    {"Not implemented yet.", 100},
  126. X    {"You fool, you put it out of order!", 50},
  127. X    {"No no, read page 546, paragraph 93b of the manual.", 100},
  128. X    {"A bomb once laid, is a joy forever.", 100},
  129. X    {"C'mon, there are so many other nice pieces waiting to be moved.", 50},
  130. X    {"It iz unwize to fumble wiz beumbs.", 50},
  131. X    MEND
  132. X};
  133. X
  134. XMESSAGE    kill_own [] = {            /* trying to "hit" one of your own */
  135. X    {"You traitor! You're attacking your own army.", 100},
  136. X    {"It turned out to be a draw.  They return to their positions.", 50},
  137. X    {"Yeez, watch out will ye.  Somebody's gonna get hurt!", 100},
  138. X    {"Oh you cannibal, you will be sorry for this!", 50},
  139. X    {"Fortunately, your subordinates do have brains.", 100},
  140. X    {"It can't be that hopeless.", 50},
  141. X    {"Wait, wait, I think that's page 546, paragraph 93c of the manual.",
  142. X        100},
  143. X    {"Rebellion!  There's a coup going on!", 100},
  144. X    MEND
  145. X};
  146. X
  147. XMESSAGE    illegal [] = {            /* all other illegal moves */
  148. X    {"Illegal move.", 100},
  149. X    {"Read page 546, paragraph 93d of the manual.", 50},
  150. X    {"Wait!  Read page 546, paragraph 93e of the manual.", 50},
  151. X    {"No!  Read page 546, paragraph 93f of the manual.", 50},
  152. X    {"\"Mother, somebody is cheating again\"", 50},
  153. X    {"No dice, sucker...", 100},
  154. X    {"End of input?", 50},
  155. X    {"Interesting...", 100},
  156. X    {"Something wrong with your eyes, squarehead?", 100},
  157. X    {"Take a day off.", 100},
  158. X    {"Ha ha.", 50},
  159. X    MEND
  160. X};
  161. X
  162. XMESSAGE    finished_premature [] = {    /* illegal board setup */
  163. X    {"Don't fool around", 100},
  164. X    {"Something's missing...", 100},
  165. X    {"No no, I insist you get a fair chance.", 100},
  166. X    MEND
  167. X};
  168. X
  169. XMESSAGE in_water [] = {            /* moving a piece into the water */
  170. X    {"If you wanted that piece to swim across, \
  171. Xyou should have said \"swim\".", 50},
  172. X    {"He can't. The piranhas will eat him.", 100},
  173. X    {"Blub. Bloeb.", 100},
  174. X    {"You'll first have to teach him how to swim!", 50},
  175. X    {"Remember the Titanic...", 100},
  176. X    MEND
  177. X};
  178. X    
  179. XMESSAGE    win_capture [] = {        /* hitting enemy piece (and winning) */
  180. X    {"Bang!!", 50},
  181. X    {"Did you consider the possibility that his marshall was there?", 10},
  182. X    {"You'll lose either way.", 100},
  183. X    {"You'll win anyway.", 50},
  184. X    {"Try to move one of his, you might find out what it is!", 50},
  185. X    {"I'd have moved the other one.", 100},
  186. X    {"WARNING:  It's against the rules to click Give Up.", 50},
  187. X    {"Ok, how about Remise now.", 50},
  188. X    {"His flag is more to the left.", 10},
  189. X    {"Ok, who's to get slaughtered next?", 100},
  190. X    {"Well, at least there's more room now.", 100},
  191. X    {"D-d-d-d-destruction!!!", 50},
  192. X    {"Dead and buried.", 100},
  193. X    {"Surprise!", 100},
  194. X    {"Kling, klang!", 100},
  195. X    MEND
  196. X};
  197. X
  198. XMESSAGE    lose_capture [] = {        /* hitting enemy piece (and losing) */
  199. X    {"Bang!!", 50},
  200. X    {"NOW he does it!", 50},
  201. X    {"You really blew it, sucker.", 50},
  202. X    {"Did you consider the possibility that his marshall was there?", 10},
  203. X    {"You'll lose either way.", 100},
  204. X    {"You'll win anyway.", 50},
  205. X    {"Try to move one of his, you might find out what it is!", 50},
  206. X    {"You should have put a bomb in front.", 50},
  207. X    {"I would have moved the other one.", 100},
  208. X    {"Oh oh, somebody is coming.", 100},
  209. X    {"WARNING:  It's against the rules to click Give Up.", 50},
  210. X    {"Ok, how about an Remise now.", 50},
  211. X    {"Ok, who will be slaughtered next?", 100},
  212. X    {"Well, at least there's more room now.", 100},
  213. X    {"D-d-d-d-destruction!!!", 50},
  214. X    {"Dead and buried.", 100},
  215. X    {"Surprise!", 100},
  216. X    {"Klang, kling!", 100},
  217. X    MEND
  218. X};
  219. X
  220. X/*
  221. X * Returns message of m (ptr).
  222. X */
  223. X#define        mesg(m)        (m->_mesg)
  224. X
  225. X/*
  226. X * Retruns chance of m (ptr).
  227. X */
  228. X#define        chance(m)    (m->_chance)
  229. X
  230. X/*
  231. X * Returns 1 if chance of m > 100, else 0.
  232. X */
  233. X#define        mnul(m)        (chance (m) > 100)
  234. X
  235. Xextern     rand ();    /* Returns number between 0 .. very large */
  236. X
  237. X/*
  238. X * Buzz returns pointer to (random) message from mesg_tab.
  239. X * Mesg_tab is seen as array of MESSAGE's, terminated by a MNUL entry.
  240. X * All messages with equal "chance" (>=0, <=100) have equal chance to be
  241. X * selected.  All messages with chance k.X have a
  242. X * k times bigger chance as all messages with chance X.
  243. X */
  244. Xchar *
  245. Xbuzz (mesg_tab)
  246. XMESSAGE    *mesg_tab;
  247. X{
  248. X#    define    lowrand        1        /* lower bound random number */
  249. X    register unsigned upprand = 0;        /* upper bound random number */
  250. X    register unsigned chanceacc = 0;    /* accumulated chances  */
  251. X    register unsigned chancebound;        /* usable random number  */
  252. X    register MESSAGE  *m;
  253. X
  254. X    if (mesg_tab == (MESSAGE *) 0)
  255. X        return NIL_CHAR;
  256. X
  257. X    for (m = mesg_tab; !mnul (m); m++)
  258. X        upprand += chance (m);
  259. X    
  260. X    if (upprand != 0)
  261. X        chancebound = ((rand () % (upprand - lowrand + 1))) + lowrand;
  262. X    else
  263. X        chancebound = 1;
  264. X
  265. X    for (m = mesg_tab; !mnul (m); m++) {
  266. X        chanceacc += chance (m);
  267. X        if (chancebound <= chanceacc)
  268. X            return mesg (m);
  269. X    }
  270. X
  271. X    return NIL_CHAR;
  272. X}
  273. END_OF_FILE
  274. if test 6956 -ne `wc -c <'buzz.c'`; then
  275.     echo shar: \"'buzz.c'\" unpacked with wrong size!
  276. fi
  277. # end of 'buzz.c'
  278. fi
  279. if test -f 'callback.c' -a "${1}" != "-c" ; then 
  280.   echo shar: Will not clobber existing file \"'callback.c'\"
  281. else
  282. echo shar: Extracting \"'callback.c'\" \(2651 characters\)
  283. sed "s/^X//" >'callback.c' <<'END_OF_FILE'
  284. X/*
  285. X * Callback.c
  286. X */
  287. X
  288. X#include "stratego.h"
  289. X
  290. X/*
  291. X * BoardPosition Callback Routine.
  292. X */
  293. XXtCallbackProc ActivateBoardPosition (widget, board_pos)
  294. XWidget widget;
  295. XBOARD_POS *board_pos;
  296. X{
  297. X    if (players[0].confirm)
  298. X        ConfirmMove ();
  299. X
  300. X    if (players[0].status == PL_SETUP)
  301. X        setup_tile (board_pos);
  302. X    else if (players[0].status == PL_ENDGAME)
  303. X        message ("The game has ended!");
  304. X    else if (players[0].status >= PL_PLAYING)
  305. X        play_tile (board_pos);
  306. X    else
  307. X        message ("It is not your turn %s.", players[0].name);
  308. X}
  309. X
  310. Xvoid AssignBoardPosition (board_pos, tile, owner)
  311. XBOARD_POS *board_pos;
  312. XTILE *tile;
  313. Xint owner;
  314. X{
  315. X    Pixmap pixmap;
  316. X    Arg args[1];
  317. X
  318. X    if (owner == O_ENEMY && tile->value >= FLAG && tile->value <= BOMB)
  319. X        pixmap = tiles[ENEMY].pixmap;
  320. X    else
  321. X        pixmap = tile->pixmap;
  322. X
  323. X    board_pos->owner = owner;
  324. X    board_pos->value = tile->value;
  325. X
  326. X    XtSetArg (args[0], XtNbitmap, pixmap);
  327. X    XtSetValues (board_pos->widget, args, 1);
  328. X}
  329. X
  330. Xvoid MarkBoardPosition (board_pos, reveal)
  331. XBOARD_POS *board_pos;
  332. XBoolean reveal;
  333. X{
  334. X    Pixmap pixmap;
  335. X    Arg args[1];
  336. X
  337. X    if (reveal == True)
  338. X        pixmap = tiles[board_pos->value].stippled_pixmap;
  339. X    else if (board_pos->owner == O_ENEMY) 
  340. X        pixmap = tiles[ENEMY].pixmap;
  341. X    else
  342. X        pixmap = tiles[board_pos->value].pixmap;
  343. X
  344. X    XtSetArg (args[0], XtNbitmap, pixmap);
  345. X    XtSetValues (board_pos->widget, args, 1);
  346. X}
  347. X
  348. Xvoid UpdateTileCount (tile, delta)
  349. XTILE *tile;
  350. Xint delta;
  351. X{
  352. X    Arg args[2];
  353. X    char num_buf[5];
  354. X
  355. X    tile->count += delta;
  356. X
  357. X    if (tile->count == 0) {
  358. X        strcpy (num_buf, " - ");
  359. X        XtSetArg (args[0], XtNhighlightThickness, 0);
  360. X        XtSetArg (args[1], XtNbitmap, tile->stippled_pixmap);
  361. X        XtSetValues (tile->bitmap_widget, args, 2);
  362. X    }
  363. X    else {
  364. X        sprintf (num_buf, " %d ", tile->count);
  365. X        if (tile->count == delta) {
  366. X            if (players[0].status == PL_SETUP)
  367. X                XtSetArg (args[0], XtNhighlightThickness, 1);
  368. X            else
  369. X                XtSetArg (args[0], XtNhighlightThickness, 0);
  370. X            XtSetArg (args[1], XtNbitmap, tile->pixmap);
  371. X            XtSetValues (tile->bitmap_widget, args, 2);
  372. X        }
  373. X    }
  374. X
  375. X    XtSetArg (args[0], XtNlabel, num_buf);
  376. X    XtSetValues (tile->count_widget, args, 1);
  377. X}
  378. X
  379. XXtActionHookProc ButtonPressHook (widget, data, action_name, event, params, cnt)
  380. XWidget widget;
  381. XXtPointer data;
  382. XString action_name;
  383. XXEvent *event;
  384. XString *params;
  385. XCardinal *cnt;
  386. X{
  387. X    if (event->type == ButtonPress) {
  388. X        message ("");
  389. X        if (players[0].confirm)
  390. X            ConfirmMove ();
  391. X    }
  392. X}
  393. X
  394. X#include <varargs.h>
  395. X
  396. X/*VARARGS0*/
  397. Xvoid message (va_alist)
  398. Xva_dcl
  399. X{
  400. X    static char msg_buf[BUFSIZ];
  401. X    va_list arglist;
  402. X    char *fmt;
  403. X    Arg args[1];
  404. X
  405. X    va_start (arglist);
  406. X    fmt = va_arg (arglist, char *);
  407. X
  408. X    vsprintf (msg_buf, fmt, arglist);
  409. X    va_end (arglist);
  410. X
  411. X    XtSetArg (args[0], XtNlabel, msg_buf);
  412. X    XtSetValues (Message, args, 1);
  413. X}
  414. END_OF_FILE
  415. if test 2651 -ne `wc -c <'callback.c'`; then
  416.     echo shar: \"'callback.c'\" unpacked with wrong size!
  417. fi
  418. # end of 'callback.c'
  419. fi
  420. if test -f 'icons/captain_mask.h' -a "${1}" != "-c" ; then 
  421.   echo shar: Will not clobber existing file \"'icons/captain_mask.h'\"
  422. else
  423. echo shar: Extracting \"'icons/captain_mask.h'\" \(1502 characters\)
  424. sed "s/^X//" >'icons/captain_mask.h' <<'END_OF_FILE'
  425. X#define captain_mask_width 35
  426. X#define captain_mask_height 43
  427. X#define captain_mask_x_hot -1
  428. X#define captain_mask_y_hot -1
  429. Xstatic char captain_mask_bits[] = {
  430. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
  431. X   0x00, 0x00, 0x00, 0x80, 0x0f, 0x3e, 0x00, 0x00, 0x80, 0xef, 0x3f, 0x00,
  432. X   0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00,
  433. X   0xfe, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0xfc, 0xff,
  434. X   0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00,
  435. X   0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0xfe,
  436. X   0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0x03,
  437. X   0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00,
  438. X   0xf8, 0xff, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x80, 0xf8, 0xff,
  439. X   0x07, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00,
  440. X   0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xfc,
  441. X   0xff, 0x03, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0x03,
  442. X   0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00,
  443. X   0xf8, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff,
  444. X   0x01, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,
  445. X   0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0xc0,
  446. X   0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00,
  447. X   0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  448. END_OF_FILE
  449. if test 1502 -ne `wc -c <'icons/captain_mask.h'`; then
  450.     echo shar: \"'icons/captain_mask.h'\" unpacked with wrong size!
  451. fi
  452. # end of 'icons/captain_mask.h'
  453. fi
  454. if test -f 'icons/colonel_mask.h' -a "${1}" != "-c" ; then 
  455.   echo shar: Will not clobber existing file \"'icons/colonel_mask.h'\"
  456. else
  457. echo shar: Extracting \"'icons/colonel_mask.h'\" \(1502 characters\)
  458. sed "s/^X//" >'icons/colonel_mask.h' <<'END_OF_FILE'
  459. X#define colonel_mask_width 35
  460. X#define colonel_mask_height 43
  461. X#define colonel_mask_x_hot -1
  462. X#define colonel_mask_y_hot -1
  463. Xstatic char colonel_mask_bits[] = {
  464. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00,
  465. X   0xfc, 0x03, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0xff, 0x0f,
  466. X   0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00,
  467. X   0x80, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff,
  468. X   0x3f, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0x00,
  469. X   0x00, 0xfe, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0xe0, 0xff,
  470. X   0xff, 0x1f, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xff, 0x1f,
  471. X   0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0xff, 0x03, 0x00, 0xf0,
  472. X   0xff, 0xff, 0x03, 0x00, 0x70, 0xff, 0xff, 0x03, 0x00, 0x20, 0xfe, 0xff,
  473. X   0x03, 0x00, 0x20, 0xfc, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00,
  474. X   0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0xf0,
  475. X   0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0x03,
  476. X   0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00,
  477. X   0xe0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x80, 0xc0, 0xff,
  478. X   0x01, 0x00, 0xc0, 0x81, 0xff, 0x01, 0x00, 0xe0, 0x83, 0xff, 0x01, 0x00,
  479. X   0xe0, 0x83, 0xff, 0x01, 0x00, 0xf0, 0xc7, 0xff, 0x03, 0x00, 0xf8, 0xcf,
  480. X   0xff, 0x03, 0x00, 0xf0, 0xc7, 0xff, 0x03, 0x00, 0xf0, 0x87, 0xff, 0x01,
  481. X   0x00, 0xf8, 0x0f, 0xfe, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00};
  482. END_OF_FILE
  483. if test 1502 -ne `wc -c <'icons/colonel_mask.h'`; then
  484.     echo shar: \"'icons/colonel_mask.h'\" unpacked with wrong size!
  485. fi
  486. # end of 'icons/colonel_mask.h'
  487. fi
  488. if test -f 'icons/enemy_mask.h' -a "${1}" != "-c" ; then 
  489.   echo shar: Will not clobber existing file \"'icons/enemy_mask.h'\"
  490. else
  491. echo shar: Extracting \"'icons/enemy_mask.h'\" \(1492 characters\)
  492. sed "s/^X//" >'icons/enemy_mask.h' <<'END_OF_FILE'
  493. X#define enemy_mask_width 35
  494. X#define enemy_mask_height 43
  495. X#define enemy_mask_x_hot -1
  496. X#define enemy_mask_y_hot -1
  497. Xstatic char enemy_mask_bits[] = {
  498. X   0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x39, 0xe0, 0x9c, 0xe3, 0xce, 0x39,
  499. X   0xe0, 0x9c, 0xe3, 0xfe, 0x3f, 0xe0, 0xff, 0xe3, 0xfe, 0x3f, 0xe0, 0xff,
  500. X   0xe3, 0xfe, 0x3f, 0xff, 0xff, 0xe3, 0xf0, 0x07, 0x1f, 0x7f, 0xe0, 0xf0,
  501. X   0x87, 0x1f, 0x7f, 0xe0, 0xf0, 0xc7, 0x3f, 0x7f, 0xe0, 0xf0, 0xc7, 0x3f,
  502. X   0x7f, 0x00, 0xf0, 0xc7, 0x3f, 0x7f, 0x00, 0xf0, 0xc7, 0x7f, 0x7f, 0x00,
  503. X   0xf0, 0xc7, 0x7f, 0x7f, 0x00, 0xf0, 0xc7, 0x7f, 0x7f, 0x00, 0xf0, 0xff,
  504. X   0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f,
  505. X   0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0,
  506. X   0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0xff,
  507. X   0x7f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0x03,
  508. X   0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff,
  509. X   0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff,
  510. X   0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe,
  511. X   0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff,
  512. X   0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03,
  513. X   0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff,
  514. X   0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff,
  515. X   0x03, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00};
  516. END_OF_FILE
  517. if test 1492 -ne `wc -c <'icons/enemy_mask.h'`; then
  518.     echo shar: \"'icons/enemy_mask.h'\" unpacked with wrong size!
  519. fi
  520. # end of 'icons/enemy_mask.h'
  521. fi
  522. if test -f 'icons/general_mask.h' -a "${1}" != "-c" ; then 
  523.   echo shar: Will not clobber existing file \"'icons/general_mask.h'\"
  524. else
  525. echo shar: Extracting \"'icons/general_mask.h'\" \(1502 characters\)
  526. sed "s/^X//" >'icons/general_mask.h' <<'END_OF_FILE'
  527. X#define general_mask_width 35
  528. X#define general_mask_height 43
  529. X#define general_mask_x_hot -1
  530. X#define general_mask_y_hot -1
  531. Xstatic char general_mask_bits[] = {
  532. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff,
  533. X   0x01, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00,
  534. X   0x00, 0x80, 0xff, 0x81, 0x10, 0x00, 0x80, 0xff, 0xc1, 0x39, 0x00, 0x00,
  535. X   0xff, 0xe1, 0x7f, 0x00, 0x00, 0xff, 0xc1, 0x39, 0x00, 0x00, 0xfe, 0x80,
  536. X   0x10, 0x00, 0x00, 0xfc, 0x83, 0x10, 0x00, 0x00, 0xfc, 0xc7, 0x39, 0x00,
  537. X   0x00, 0xfe, 0xef, 0x7f, 0x00, 0x00, 0xfe, 0xcf, 0x39, 0x00, 0x00, 0xff,
  538. X   0x9f, 0x10, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00,
  539. X   0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80,
  540. X   0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x80, 0xff, 0xff,
  541. X   0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00,
  542. X   0xe0, 0xff, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff,
  543. X   0x1f, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
  544. X   0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00,
  545. X   0xfe, 0x1f, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0x1f,
  546. X   0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00,
  547. X   0xf0, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff,
  548. X   0x7f, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00,
  549. X   0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  550. END_OF_FILE
  551. if test 1502 -ne `wc -c <'icons/general_mask.h'`; then
  552.     echo shar: \"'icons/general_mask.h'\" unpacked with wrong size!
  553. fi
  554. # end of 'icons/general_mask.h'
  555. fi
  556. if test -f 'icons/lieutenant.h' -a "${1}" != "-c" ; then 
  557.   echo shar: Will not clobber existing file \"'icons/lieutenant.h'\"
  558. else
  559. echo shar: Extracting \"'icons/lieutenant.h'\" \(1492 characters\)
  560. sed "s/^X//" >'icons/lieutenant.h' <<'END_OF_FILE'
  561. X#define lieutenant_width 35
  562. X#define lieutenant_height 43
  563. X#define lieutenant_x_hot 17
  564. X#define lieutenant_y_hot 24
  565. Xstatic char lieutenant_bits[] = {
  566. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  567. X   0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00,
  568. X   0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
  569. X   0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x03,
  570. X   0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x00, 0x00,
  571. X   0x00, 0xcc, 0x3e, 0x01, 0x00, 0x00, 0xf2, 0xfe, 0x01, 0x00, 0x00, 0xff,
  572. X   0xfe, 0x01, 0x00, 0x00, 0x6f, 0x7e, 0x01, 0x00, 0x00, 0x7a, 0x3d, 0x00,
  573. X   0x00, 0x00, 0xf2, 0x5c, 0x01, 0x00, 0x00, 0xcb, 0x47, 0x01, 0x00, 0x00,
  574. X   0x3b, 0xf0, 0x01, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00, 0x00, 0xf2, 0xff,
  575. X   0x00, 0x00, 0x00, 0xf2, 0xff, 0x00, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00,
  576. X   0x00, 0x52, 0x57, 0x00, 0x00, 0x00, 0x12, 0x40, 0x00, 0x00, 0x00, 0x32,
  577. X   0x43, 0x00, 0x00, 0x00, 0x16, 0x20, 0x00, 0x00, 0x00, 0x66, 0x20, 0x00,
  578. X   0x00, 0x00, 0xe4, 0x38, 0x00, 0x00, 0x00, 0xa4, 0x2f, 0x00, 0x00, 0x00,
  579. X   0x64, 0x77, 0x00, 0x00, 0x00, 0xe4, 0x7a, 0x00, 0x00, 0xf0, 0xef, 0xfd,
  580. X   0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x01, 0xf8, 0x4f, 0x10, 0xff, 0x01,
  581. X   0xd8, 0x03, 0x00, 0xbc, 0x01, 0x58, 0x27, 0x20, 0xae, 0x01, 0x50, 0x03,
  582. X   0x00, 0xac, 0x00, 0x50, 0x13, 0x80, 0xac, 0x00, 0x40, 0x03, 0x00, 0x2c,
  583. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  584. END_OF_FILE
  585. if test 1492 -ne `wc -c <'icons/lieutenant.h'`; then
  586.     echo shar: \"'icons/lieutenant.h'\" unpacked with wrong size!
  587. fi
  588. # end of 'icons/lieutenant.h'
  589. fi
  590. if test -f 'icons/lieutenant_mask.h' -a "${1}" != "-c" ; then 
  591.   echo shar: Will not clobber existing file \"'icons/lieutenant_mask.h'\"
  592. else
  593. echo shar: Extracting \"'icons/lieutenant_mask.h'\" \(1517 characters\)
  594. sed "s/^X//" >'icons/lieutenant_mask.h' <<'END_OF_FILE'
  595. X#define lieutenant_mask_width 35
  596. X#define lieutenant_mask_height 43
  597. X#define lieutenant_mask_x_hot -1
  598. X#define lieutenant_mask_y_hot -1
  599. Xstatic char lieutenant_mask_bits[] = {
  600. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
  601. X   0x1f, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00,
  602. X   0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00,
  603. X   0xc0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x1f,
  604. X   0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00,
  605. X   0x00, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff,
  606. X   0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x03,
  607. X   0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x80,
  608. X   0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff,
  609. X   0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00,
  610. X   0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff,
  611. X   0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
  612. X   0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00,
  613. X   0xfe, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff,
  614. X   0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0x03,
  615. X   0xfc, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff,
  616. X   0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff,
  617. X   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  618. END_OF_FILE
  619. if test 1517 -ne `wc -c <'icons/lieutenant_mask.h'`; then
  620.     echo shar: \"'icons/lieutenant_mask.h'\" unpacked with wrong size!
  621. fi
  622. # end of 'icons/lieutenant_mask.h'
  623. fi
  624. if test -f 'icons/major_mask.h' -a "${1}" != "-c" ; then 
  625.   echo shar: Will not clobber existing file \"'icons/major_mask.h'\"
  626. else
  627. echo shar: Extracting \"'icons/major_mask.h'\" \(1492 characters\)
  628. sed "s/^X//" >'icons/major_mask.h' <<'END_OF_FILE'
  629. X#define major_mask_width 35
  630. X#define major_mask_height 43
  631. X#define major_mask_x_hot -1
  632. X#define major_mask_y_hot -1
  633. Xstatic char major_mask_bits[] = {
  634. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  635. X   0xa0, 0x04, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x0f,
  636. X   0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00,
  637. X   0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff,
  638. X   0x3f, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x00,
  639. X   0xc0, 0xff, 0xff, 0x7f, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff,
  640. X   0xff, 0x3f, 0x00, 0x00, 0xdf, 0xff, 0x3f, 0x00, 0x00, 0xcc, 0xff, 0x1f,
  641. X   0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00,
  642. X   0xf0, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff,
  643. X   0x07, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
  644. X   0x80, 0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0xe0, 0xff,
  645. X   0xff, 0x01, 0x00, 0xf0, 0xff, 0xff, 0x01, 0x00, 0xf0, 0xff, 0xff, 0x01,
  646. X   0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x80,
  647. X   0xff, 0xff, 0x07, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0x7f,
  648. X   0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x08, 0x00,
  649. X   0x00, 0xff, 0x7f, 0x1c, 0x00, 0x00, 0xff, 0x7f, 0x3e, 0x00, 0x00, 0xfe,
  650. X   0x1f, 0x1c, 0x00, 0x00, 0xfe, 0x83, 0xff, 0x00, 0x00, 0x7e, 0x80, 0xff,
  651. X   0x00, 0x00, 0x0e, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  652. END_OF_FILE
  653. if test 1492 -ne `wc -c <'icons/major_mask.h'`; then
  654.     echo shar: \"'icons/major_mask.h'\" unpacked with wrong size!
  655. fi
  656. # end of 'icons/major_mask.h'
  657. fi
  658. if test -f 'icons/marshal_mask.h' -a "${1}" != "-c" ; then 
  659.   echo shar: Will not clobber existing file \"'icons/marshal_mask.h'\"
  660. else
  661. echo shar: Extracting \"'icons/marshal_mask.h'\" \(1502 characters\)
  662. sed "s/^X//" >'icons/marshal_mask.h' <<'END_OF_FILE'
  663. X#define marshal_mask_width 35
  664. X#define marshal_mask_height 43
  665. X#define marshal_mask_x_hot -1
  666. X#define marshal_mask_y_hot -1
  667. Xstatic char marshal_mask_bits[] = {
  668. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0xf0,
  669. X   0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0x7f,
  670. X   0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x98, 0xf9, 0xff, 0xff, 0x00, 0x9c,
  671. X   0xfb, 0xff, 0xff, 0x00, 0x90, 0xf8, 0xff, 0x7f, 0x00, 0x60, 0xf8, 0xff,
  672. X   0x7f, 0x00, 0x60, 0xf8, 0xff, 0x7f, 0x00, 0x90, 0xf8, 0xff, 0x1f, 0x00,
  673. X   0x9c, 0xfb, 0xff, 0x3f, 0x00, 0x98, 0xfd, 0xff, 0x3f, 0x00, 0x00, 0xfe,
  674. X   0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x80, 0xff, 0xff, 0x07,
  675. X   0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0xf0,
  676. X   0xff, 0xff, 0x07, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0xff,
  677. X   0x0f, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00,
  678. X   0xfc, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xff,
  679. X   0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x00,
  680. X   0x00, 0xf0, 0xff, 0xff, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0xe0,
  681. X   0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff,
  682. X   0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00,
  683. X   0xf8, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff,
  684. X   0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff,
  685. X   0x00, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  686. END_OF_FILE
  687. if test 1502 -ne `wc -c <'icons/marshal_mask.h'`; then
  688.     echo shar: \"'icons/marshal_mask.h'\" unpacked with wrong size!
  689. fi
  690. # end of 'icons/marshal_mask.h'
  691. fi
  692. if test -f 'icons/miner_mask.h' -a "${1}" != "-c" ; then 
  693.   echo shar: Will not clobber existing file \"'icons/miner_mask.h'\"
  694. else
  695. echo shar: Extracting \"'icons/miner_mask.h'\" \(1492 characters\)
  696. sed "s/^X//" >'icons/miner_mask.h' <<'END_OF_FILE'
  697. X#define miner_mask_width 35
  698. X#define miner_mask_height 43
  699. X#define miner_mask_x_hot -1
  700. X#define miner_mask_y_hot -1
  701. Xstatic char miner_mask_bits[] = {
  702. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x80,
  703. X   0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x7f,
  704. X   0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00,
  705. X   0xfe, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff,
  706. X   0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03,
  707. X   0xc0, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0x03, 0xf0, 0xff,
  708. X   0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff,
  709. X   0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xfe,
  710. X   0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff,
  711. X   0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0x03,
  712. X   0xe0, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff,
  713. X   0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0x1f,
  714. X   0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x80,
  715. X   0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff,
  716. X   0x1f, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00,
  717. X   0x00, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0xfe,
  718. X   0xff, 0x03, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00,
  719. X   0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  720. END_OF_FILE
  721. if test 1492 -ne `wc -c <'icons/miner_mask.h'`; then
  722.     echo shar: \"'icons/miner_mask.h'\" unpacked with wrong size!
  723. fi
  724. # end of 'icons/miner_mask.h'
  725. fi
  726. if test -f 'icons/scout_mask.h' -a "${1}" != "-c" ; then 
  727.   echo shar: Will not clobber existing file \"'icons/scout_mask.h'\"
  728. else
  729. echo shar: Extracting \"'icons/scout_mask.h'\" \(1492 characters\)
  730. sed "s/^X//" >'icons/scout_mask.h' <<'END_OF_FILE'
  731. X#define scout_mask_width 35
  732. X#define scout_mask_height 43
  733. X#define scout_mask_x_hot -1
  734. X#define scout_mask_y_hot -1
  735. Xstatic char scout_mask_bits[] = {
  736. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0xf8,
  737. X   0x03, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00,
  738. X   0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00,
  739. X   0xfe, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff,
  740. X   0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00,
  741. X   0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe,
  742. X   0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f,
  743. X   0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00,
  744. X   0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff,
  745. X   0x0f, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00,
  746. X   0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0xf8,
  747. X   0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0x1f,
  748. X   0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0,
  749. X   0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff,
  750. X   0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00,
  751. X   0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff,
  752. X   0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x0f,
  753. X   0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  754. END_OF_FILE
  755. if test 1492 -ne `wc -c <'icons/scout_mask.h'`; then
  756.     echo shar: \"'icons/scout_mask.h'\" unpacked with wrong size!
  757. fi
  758. # end of 'icons/scout_mask.h'
  759. fi
  760. if test -f 'icons/sergeant_mask.h' -a "${1}" != "-c" ; then 
  761.   echo shar: Will not clobber existing file \"'icons/sergeant_mask.h'\"
  762. else
  763. echo shar: Extracting \"'icons/sergeant_mask.h'\" \(1507 characters\)
  764. sed "s/^X//" >'icons/sergeant_mask.h' <<'END_OF_FILE'
  765. X#define sergeant_mask_width 35
  766. X#define sergeant_mask_height 43
  767. X#define sergeant_mask_x_hot -1
  768. X#define sergeant_mask_y_hot -1
  769. Xstatic char sergeant_mask_bits[] = {
  770. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x3e,
  771. X   0xc0, 0x3f, 0x00, 0x00, 0xff, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x3f,
  772. X   0x00, 0x00, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0xc0,
  773. X   0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff,
  774. X   0x3f, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00,
  775. X   0xc0, 0xff, 0xff, 0x7f, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe,
  776. X   0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0xfc, 0xff, 0x7f,
  777. X   0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00,
  778. X   0xfe, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff,
  779. X   0x3f, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00,
  780. X   0x80, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0xc0, 0xff,
  781. X   0xff, 0x0f, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0xff, 0xff, 0x0f,
  782. X   0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x80,
  783. X   0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff,
  784. X   0x0f, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00,
  785. X   0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xfc,
  786. X   0xff, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00,
  787. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  788. END_OF_FILE
  789. if test 1507 -ne `wc -c <'icons/sergeant_mask.h'`; then
  790.     echo shar: \"'icons/sergeant_mask.h'\" unpacked with wrong size!
  791. fi
  792. # end of 'icons/sergeant_mask.h'
  793. fi
  794. if test -f 'init.c' -a "${1}" != "-c" ; then 
  795.   echo shar: Will not clobber existing file \"'init.c'\"
  796. else
  797. echo shar: Extracting \"'init.c'\" \(4891 characters\)
  798. sed "s/^X//" >'init.c' <<'END_OF_FILE'
  799. X/*
  800. X * Init.c
  801. X *
  802. X * Icon declarations followed by Initialised tile structures.
  803. X * Initialisation routines.
  804. X */
  805. X
  806. X#include "stratego.h"
  807. X
  808. X#include "icons/free.h"
  809. X#include "icons/free_s.h"
  810. X#include "icons/free_mask.h"
  811. X
  812. X#include "icons/enemy.h"
  813. X#include "icons/enemy_s.h"
  814. X#include "icons/enemy_mask.h"
  815. X
  816. X#include "icons/flag.h"
  817. X#include "icons/flag_s.h"
  818. X#include "icons/flag_mask.h"
  819. X
  820. X#include "icons/marshal.h"
  821. X#include "icons/marshal_s.h"
  822. X#include "icons/marshal_mask.h"
  823. X
  824. X#include "icons/general.h"
  825. X#include "icons/general_s.h"
  826. X#include "icons/general_mask.h"
  827. X
  828. X#include "icons/colonel.h"
  829. X#include "icons/colonel_s.h"
  830. X#include "icons/colonel_mask.h"
  831. X
  832. X#include "icons/major.h"
  833. X#include "icons/major_s.h"
  834. X#include "icons/major_mask.h"
  835. X
  836. X#include "icons/captain.h"
  837. X#include "icons/captain_s.h"
  838. X#include "icons/captain_mask.h"
  839. X
  840. X#include "icons/lieutenant.h"
  841. X#include "icons/lieutenant_s.h"
  842. X#include "icons/lieutenant_mask.h"
  843. X
  844. X#include "icons/sergeant.h"
  845. X#include "icons/sergeant_s.h"
  846. X#include "icons/sergeant_mask.h"
  847. X
  848. X#include "icons/miner.h"
  849. X#include "icons/miner_s.h"
  850. X#include "icons/miner_mask.h"
  851. X
  852. X#include "icons/scout.h"
  853. X#include "icons/scout_s.h"
  854. X#include "icons/scout_mask.h"
  855. X
  856. X#include "icons/spy.h"
  857. X#include "icons/spy_s.h"
  858. X#include "icons/spy_mask.h"
  859. X
  860. X#include "icons/bomb.h"
  861. X#include "icons/bomb_s.h"
  862. X#include "icons/bomb_mask.h"
  863. X
  864. X#include "icons/boat_cursor.h"
  865. X#include "icons/boat_cursor_mask.h"
  866. X
  867. X#include "icons/board_cursor.h"
  868. X#include "icons/board_cursor_mask.h"
  869. X
  870. X#include "icons/account_cursor.h"
  871. X#include "icons/account_cursor_mask.h"
  872. X
  873. X#define TILE_ENTRY(name, value, count)    \
  874. X    { value, "name", name/**/_bits, name/**/_s_bits, name/**/_mask_bits, \
  875. X      (Pixmap) 0, (Pixmap) 0, (Cursor) 0, \
  876. X      name/**/_x_hot, name/**/_y_hot, name/**/_width, name/**/_height, \
  877. X      count, count }
  878. X
  879. X#define CURSOR_ENTRY(name) \
  880. X    { 0, NULL, name/**/_bits, NULL, name/**/_mask_bits, \
  881. X      (Pixmap) 0, (Pixmap) 0, (Cursor) 0, \
  882. X      name/**/_x_hot, name/**/_y_hot, name/**/_width, name/**/_height, 0,0 }
  883. X
  884. XTILE tiles[MAX_TILES + MAX_CURSORS] = {
  885. X    TILE_ENTRY (free,       FREE,       1),
  886. X    TILE_ENTRY (enemy,      ENEMY,      0),
  887. X    TILE_ENTRY (flag,       FLAG,       1),
  888. X    TILE_ENTRY (marshal,    MARSHAL,    1),
  889. X    TILE_ENTRY (general,    GENERAL,    1),
  890. X    TILE_ENTRY (colonel,    COLONEL,    2),
  891. X    TILE_ENTRY (major,      MAJOR,      3),
  892. X    TILE_ENTRY (captain,    CAPTAIN,    4),
  893. X    TILE_ENTRY (lieutenant, LIEUTENANT, 4),
  894. X    TILE_ENTRY (sergeant,   SERGEANT,   4),
  895. X    TILE_ENTRY (miner,      MINER,      5),
  896. X    TILE_ENTRY (scout,      SCOUT,      8),
  897. X    TILE_ENTRY (spy,        SPY,        1),
  898. X    TILE_ENTRY (bomb,       BOMB,       6),
  899. X    CURSOR_ENTRY (boat_cursor),
  900. X    CURSOR_ENTRY (board_cursor),
  901. X    CURSOR_ENTRY (account_cursor)
  902. X};
  903. X
  904. X/* Create tile pixmaps and cursors on board window */
  905. Xvoid init_icons ()
  906. X{
  907. X    Display *display = XDISPLAY;
  908. X    Pixmap pixmap_mask;
  909. X    XColor black_color, white_color;
  910. X    TILE *tile;
  911. X    int i;
  912. X
  913. X    XLookupColor (display, DefaultColormap (display, XSCREEN), "black",
  914. X              &black_color, &black_color);
  915. X    XLookupColor (display, DefaultColormap (display, XSCREEN), "white",
  916. X              &white_color, &white_color);
  917. X
  918. X        for (i = 0; i < MAX_TILES + MAX_CURSORS; i++) {
  919. X                tile = &tiles[i];
  920. X                tile->pixmap = XCreateBitmapFromData (display, XROOTWINDOW,
  921. X                                        tile->bitmap,
  922. X                                        tile->width, tile->height);
  923. X                pixmap_mask  = XCreateBitmapFromData (display, XROOTWINDOW,
  924. X                                            tile->bitmap_mask,
  925. X                                            tile->width, tile->height);
  926. X
  927. X                tile->cursor = XCreatePixmapCursor (display, tile->pixmap,
  928. X                                        pixmap_mask,
  929. X                                        &black_color, &white_color,
  930. X                                        tile->hotspot_x, tile->hotspot_y);
  931. X                XFreePixmap (display, pixmap_mask);
  932. X                XFreePixmap (display, tile->pixmap);
  933. X
  934. X        if (tile->name == NULL)
  935. X            continue;        /* Cursor entry */
  936. X
  937. X                tile->pixmap = XCreateBitmapFromData (display, XROOTWINDOW,
  938. X                                        tile->bitmap,
  939. X                                        tile->width, tile->height);
  940. X                tile->stippled_pixmap = XCreateBitmapFromData (display,
  941. X                        XROOTWINDOW,
  942. X                                            tile->stippled_bitmap,
  943. X                                            tile->width, tile->height);
  944. X        }
  945. X
  946. X    XFreeCursor (display, tiles[FREE].cursor);
  947. X    tiles[FREE].cursor = tiles[BOARD_CURSOR].cursor;
  948. X}
  949. X
  950. Xvoid init_board ()
  951. X{
  952. X    int y, x;
  953. X
  954. X    for (y = MAX_ROWS - 1; y >= 0; y--)
  955. X        for (x = MAX_COLS - 1; x >= 0; x--)
  956. X            board[y][x].owner = O_NOBODY;
  957. X
  958. X    board[4][2].value = board[4][3].value = WATER;
  959. X    board[5][2].value = board[5][3].value = WATER;
  960. X
  961. X    board[4][6].value = board[4][7].value = WATER;
  962. X    board[5][6].value = board[5][7].value = WATER;
  963. X}
  964. END_OF_FILE
  965. if test 4891 -ne `wc -c <'init.c'`; then
  966.     echo shar: \"'init.c'\" unpacked with wrong size!
  967. fi
  968. # end of 'init.c'
  969. fi
  970. if test -f 'message.c' -a "${1}" != "-c" ; then 
  971.   echo shar: Will not clobber existing file \"'message.c'\"
  972. else
  973. echo shar: Extracting \"'message.c'\" \(5315 characters\)
  974. sed "s/^X//" >'message.c' <<'END_OF_FILE'
  975. X/*
  976. X * Message.c
  977. X *
  978. X * Player to player messages module.
  979. X */
  980. X
  981. X#include "stratego.h"
  982. X
  983. X#include <sys/filio.h>
  984. X#include <varargs.h>
  985. X
  986. X#define REMISE_CONFIRMED    0
  987. X#define REMISE_DENIED        1
  988. X
  989. X#define T_MOVE        '0'        /* Messages during play */
  990. X#define T_REMISE    '1'
  991. X#define T_REMISE_ANSWER    '2'
  992. X
  993. X#define T_PLACED_TILE    '3'        /* Messages during setup */
  994. X#define T_SETUP_READY    '4'
  995. X#define T_CLEAR_BOARD    '5'
  996. X
  997. X#define T_QUIT        '6'        /* General messages */
  998. X#define T_MAIL        '7'
  999. X
  1000. X#define MESSAGE_LENGTH    125
  1001. X
  1002. Xstatic char message_buffer[MESSAGE_LENGTH];
  1003. Xstatic char message_length[4];
  1004. X
  1005. Xstatic void receive_ready (), receive_move (), receive_placed_tile (),
  1006. X        receive_remise_answer (), receive_clear_board (),
  1007. X        receive_quit ();
  1008. X
  1009. Xvoid end_communications()
  1010. X{
  1011. X    if (players[1].fd > 0) {
  1012. X        XtRemoveInput (EnemyID);
  1013. X        players[1].fd = -1;
  1014. X    }
  1015. X}
  1016. X
  1017. Xstatic void read_data (fd, output, length)
  1018. Xint fd, length;
  1019. Xchar *output;
  1020. X{
  1021. X    extern int errno;
  1022. X
  1023. X    if (read (fd, output, length) == length)
  1024. X        return;
  1025. X
  1026. X    if (errno != 0)
  1027. X        perror ("read_data()");
  1028. X
  1029. X    printf("Communications breakdown. Host/Program crash on other side?\n");
  1030. X
  1031. X    XtDestroyApplicationContext (app_con);
  1032. X    exit (1);
  1033. X}
  1034. X
  1035. XXtInputCallbackProc EnemyInterrupt (client_data, source, id)
  1036. XXtPointer client_data;
  1037. Xint *source;
  1038. XXtInputId *id;
  1039. X{
  1040. X    if (players[1].fd == -1)
  1041. X        return;
  1042. X
  1043. X    read_data (players[1].fd, message_length, sizeof(message_length));
  1044. X    read_data (players[1].fd, message_buffer, atoi (message_length));
  1045. X
  1046. X    switch (message_buffer[0]) {
  1047. X    case T_CLEAR_BOARD:
  1048. X        receive_clear_board ();
  1049. X        break;
  1050. X    case T_SETUP_READY:
  1051. X        receive_ready ();
  1052. X        break;
  1053. X    case T_MOVE:
  1054. X        receive_move ();
  1055. X        break;
  1056. X    case T_QUIT:
  1057. X        end_communications ();
  1058. X        receive_quit ();
  1059. X        return;
  1060. X    case T_PLACED_TILE:
  1061. X        receive_placed_tile ();
  1062. X        break;
  1063. X    case T_REMISE:
  1064. X        RemiseOffered ();
  1065. X        break;
  1066. X    case T_REMISE_ANSWER:
  1067. X        receive_remise_answer ();
  1068. X        break;
  1069. X    case T_MAIL:
  1070. X        message ("%s: \"%s\"", players[1].name,
  1071. X             &message_buffer[2]);
  1072. X        break;
  1073. X    default:
  1074. X        message ("Unknown input from opponent (type [%o] %c)",
  1075. X              message_buffer[0], message_buffer[0]);
  1076. X    }
  1077. X}
  1078. X
  1079. Xstatic void receive_clear_board ()
  1080. X{
  1081. X    int y, x;
  1082. X
  1083. X    for (y = 0; y < 4; y++) {
  1084. X        for (x = 0; x < MAX_COLS; x++) {
  1085. X            if (board[y][x].value != FREE)
  1086. X                AssignBoardPosition (&board[y][x],
  1087. X                             &tiles[FREE], O_NOBODY);
  1088. X        }
  1089. X    }
  1090. X}
  1091. X
  1092. Xstatic void receive_ready ()
  1093. X{
  1094. X    players[1].status = PL_SETUP_READY;
  1095. X    if (players[0].status == PL_SETUP)
  1096. X        message ("%s just finished his board setup. Hurry up %s!",
  1097. X              players[1].name, players[0].name);
  1098. X    else
  1099. X        start_play ();
  1100. X}
  1101. X
  1102. Xstatic void receive_quit ()
  1103. X{
  1104. X    if (players[0].status <= PL_SETUP_READY)
  1105. X        message ("%s decided to quit his setup!", players[1].name);
  1106. X    else
  1107. X        message ("You win %s, because %s admitted your superior strategy!", players[0].name, players[1].name);
  1108. X
  1109. X    end_game ();
  1110. X}
  1111. X
  1112. Xstatic void receive_placed_tile ()
  1113. X{
  1114. X    int x, y, tile_value;
  1115. X
  1116. X    sscanf (&message_buffer[1], "%d %d %d", &x, &y, &tile_value);
  1117. X    y = (MAX_ROWS - 1) - y;
  1118. X    x = (MAX_COLS - 1) - x;
  1119. X
  1120. X    AssignBoardPosition (&board[y][x], &tiles[tile_value], O_ENEMY);
  1121. X}
  1122. X
  1123. Xstatic void receive_move ()
  1124. X{
  1125. X    int from_y, from_x, to_y, to_x;
  1126. X
  1127. X    sscanf (&message_buffer[1], "%d %d %d %d", &from_y, &from_x,
  1128. X                               &to_y, &to_x);
  1129. X
  1130. X    from_x = (MAX_COLS - 1) - from_x;
  1131. X    from_y = (MAX_ROWS - 1) - from_y;
  1132. X    to_x   = (MAX_COLS - 1) - to_x;
  1133. X    to_y   = (MAX_ROWS - 1) - to_y;
  1134. X
  1135. X    switch (execute_move (&board[from_y][from_x],
  1136. X                  &board[to_y][to_x])) {
  1137. X    case REMISE_MOVE:
  1138. X    case WIN_MOVE:
  1139. X        end_game ();
  1140. X        break;
  1141. X    default:
  1142. X        check_can_play (O_PLAYER);
  1143. X        players[0].status = PL_PLAYING;
  1144. X
  1145. X        EnableRemiseButton();
  1146. X    }
  1147. X
  1148. X}
  1149. X
  1150. Xstatic void receive_remise_answer ()
  1151. X{
  1152. X    static char msg_buf[100];
  1153. X    int answer;
  1154. X
  1155. X    sscanf (&message_buffer[1], "%d", &answer);
  1156. X    
  1157. X    if (answer == REMISE_DECLINED)
  1158. X        sprintf (msg_buf, "%s declined your remise offer %s.",
  1159. X              players[1].name, players[0].name);
  1160. X
  1161. X    else
  1162. X        sprintf (msg_buf, "%s accepted your remise offer %s.",
  1163. X              players[1].name, players[0].name);
  1164. X
  1165. X    (void) DialogBoxResult (msg_buf, NULL, 0, NO_CANCEL);
  1166. X
  1167. X    if (answer == REMISE_ACCEPTED)
  1168. X        end_game ();
  1169. X}
  1170. X
  1171. X
  1172. X/*
  1173. X * Send module.
  1174. X */
  1175. X
  1176. X/*VARARGS0*/
  1177. Xstatic void send_buffer (va_alist)
  1178. Xva_dcl
  1179. X{
  1180. X    va_list arglist;
  1181. X    char *fmt;
  1182. X
  1183. X    if (players[0].status == PL_ENDGAME || players[0].setup_only)
  1184. X        return;
  1185. X
  1186. X    va_start (arglist);
  1187. X    fmt = va_arg (arglist, char *);
  1188. X
  1189. X    vsprintf (message_buffer, fmt, arglist);
  1190. X    va_end (arglist);
  1191. X
  1192. X    sprintf (message_length, "%d", strlen (message_buffer) + 1);
  1193. X
  1194. X    write (players[1].fd, message_length, sizeof (message_length));
  1195. X    write (players[1].fd, message_buffer, atoi (message_length));
  1196. X}
  1197. X
  1198. Xvoid send_ready ()
  1199. X{
  1200. X    send_buffer ("%c", T_SETUP_READY);
  1201. X}
  1202. X
  1203. Xvoid send_clear_board ()
  1204. X{
  1205. X    send_buffer ("%c", T_CLEAR_BOARD);
  1206. X}
  1207. X
  1208. Xvoid send_tile_placed (board_pos)
  1209. XBOARD_POS *board_pos;
  1210. X{
  1211. X    send_buffer ("%c %d %d %d", T_PLACED_TILE,
  1212. X             board_pos->x, board_pos->y, board_pos->value);
  1213. X}
  1214. X
  1215. Xvoid send_move (from_pos, to_pos)
  1216. XBOARD_POS *from_pos, *to_pos;
  1217. X{
  1218. X    send_buffer ("%c %d %d %d %d", T_MOVE,
  1219. X         from_pos->y, from_pos->x, to_pos->y, to_pos->x);
  1220. X}
  1221. X
  1222. Xvoid send_remise_answer (answer)
  1223. Xint answer;
  1224. X{
  1225. X    send_buffer ("%c %d", T_REMISE_ANSWER, answer);
  1226. X}
  1227. X
  1228. Xvoid send_remise_offer ()
  1229. X{
  1230. X    send_buffer ("%c", T_REMISE);
  1231. X}
  1232. X
  1233. Xvoid send_quit ()
  1234. X{
  1235. X    send_buffer ("%c", T_QUIT);
  1236. X    signal (SIGIO, SIG_IGN);
  1237. X}
  1238. X
  1239. Xvoid send_mail (mail)
  1240. Xchar *mail;
  1241. X{
  1242. X    if (players[0].status == PL_ENDGAME)
  1243. X        return;
  1244. X
  1245. X    send_buffer ("%c %s", T_MAIL, mail);
  1246. X}
  1247. END_OF_FILE
  1248. if test 5315 -ne `wc -c <'message.c'`; then
  1249.     echo shar: \"'message.c'\" unpacked with wrong size!
  1250. fi
  1251. # end of 'message.c'
  1252. fi
  1253. if test -f 'register.c' -a "${1}" != "-c" ; then 
  1254.   echo shar: Will not clobber existing file \"'register.c'\"
  1255. else
  1256. echo shar: Extracting \"'register.c'\" \(2198 characters\)
  1257. sed "s/^X//" >'register.c' <<'END_OF_FILE'
  1258. X/*
  1259. X * Register.c
  1260. X */
  1261. X
  1262. X#include "stratego.h"
  1263. X
  1264. X/*
  1265. X * Game Status Register structure definition.
  1266. X */
  1267. Xtypedef struct s_game_status {
  1268. X    int  count;        /* # times position has been registered */
  1269. X    char board_layout[MAX_ROWS * MAX_COLS + 1];
  1270. X    struct s_game_status *next;
  1271. X} GameStatusRec, *GameStatus;
  1272. X
  1273. Xstatic GameStatus status_list = NULL;
  1274. X
  1275. X#define BoardValue(y, x)    (board[(y)][(x)].owner * MAX_TILES + \
  1276. X                 board[(y)][(x)].value + ' ')
  1277. X
  1278. X/*
  1279. X * Prints remise messages. Confirms for actual remise move.
  1280. X */
  1281. Xstatic Boolean RemiseSituation(player)
  1282. Xint player;
  1283. X{
  1284. X    static char header[] = "Remise Warning!\nThis board setup has occurred twice before.\n";
  1285. X    char msg_buf[250];
  1286. X
  1287. X    if (player == O_ENEMY) {
  1288. X        sprintf (msg_buf, "%sI hereby declare a cease fire!", header);
  1289. X        (void) DialogBoxResult (msg_buf, NULL, 0, NO_CANCEL);
  1290. X        return REMISE_MOVE;
  1291. X    }
  1292. X
  1293. X    sprintf (msg_buf, "%sPlaying this move will effectuate a remise.",
  1294. X         header);
  1295. X
  1296. X    if (DialogBoxResult(msg_buf, NULL, 0, ADD_CANCEL) == False)
  1297. X        return UNDO_MOVE;
  1298. X
  1299. X    return REMISE_MOVE;
  1300. X}
  1301. X
  1302. X/*
  1303. X * Registers a board setup. Checks if position has occurred before.
  1304. X *
  1305. X * Issues a warning if position has been registered before
  1306. X * Ends game if position has been registers twice already.
  1307. X */
  1308. Xint register_board (player)
  1309. Xint player;                /* The one who is moving */
  1310. X{
  1311. X    GameStatus new, ptr;
  1312. X    int y, x;
  1313. X
  1314. X    new = XtNew(GameStatusRec);
  1315. X    for (y = 0; y < MAX_ROWS; y++)
  1316. X        for (x = 0; x < MAX_COLS; x++)
  1317. X            new->board_layout[y * MAX_ROWS + x] = BoardValue(y, x);
  1318. X    
  1319. X    new->board_layout[MAX_ROWS * MAX_COLS] = '\0';
  1320. X
  1321. X    for (ptr = status_list; ptr != NULL; ptr = ptr->next) {
  1322. X        if (!strcmp (ptr->board_layout, new->board_layout)) {
  1323. X            XtFree (new);
  1324. X
  1325. X            if (++ptr->count >= 3)
  1326. X                return RemiseSituation(player);
  1327. X
  1328. X            (void) DialogBoxResult (
  1329. X              "Remise Warning!\nThis board setup has occurred before!",
  1330. X                NULL, 0, NO_CANCEL);
  1331. X            break;
  1332. X        }
  1333. X    }
  1334. X
  1335. X    if (ptr == NULL) {
  1336. X        new->count = 1;
  1337. X        new->next = status_list;
  1338. X        status_list = new;
  1339. X    }
  1340. X
  1341. X    return DO_MOVE;
  1342. X}
  1343. X
  1344. X/*
  1345. X * Registers a tile hit. Invalidates all previous positions.
  1346. X */
  1347. Xvoid register_hit ()
  1348. X{
  1349. X    GameStatus ptr, next;
  1350. X
  1351. X    for (ptr = status_list; ptr != NULL; ptr = next) {
  1352. X        next = ptr->next;
  1353. X        XtFree (ptr);
  1354. X    }
  1355. X
  1356. X    status_list = NULL;
  1357. X}
  1358. END_OF_FILE
  1359. if test 2198 -ne `wc -c <'register.c'`; then
  1360.     echo shar: \"'register.c'\" unpacked with wrong size!
  1361. fi
  1362. # end of 'register.c'
  1363. fi
  1364. if test -f 'socket.c' -a "${1}" != "-c" ; then 
  1365.   echo shar: Will not clobber existing file \"'socket.c'\"
  1366. else
  1367. echo shar: Extracting \"'socket.c'\" \(6060 characters\)
  1368. sed "s/^X//" >'socket.c' <<'END_OF_FILE'
  1369. X/*
  1370. X * Socket.h
  1371. X *
  1372. X * Initial handshake and pecking order determination module.
  1373. X */
  1374. X
  1375. X#include "stratego.h"
  1376. X
  1377. X#include <signal.h>
  1378. X#include <sys/types.h>
  1379. X#include <sys/socket.h>
  1380. X#include <fcntl.h>
  1381. X#include <netinet/in.h>
  1382. X#include <netdb.h>
  1383. X
  1384. Xstatic struct sockaddr_in channel;
  1385. X
  1386. Xstatic void read_player_data (), write_player_data ();
  1387. Xstatic void read_data (), write_data ();
  1388. X
  1389. Xstatic void perror_exit (label)
  1390. Xchar *label;
  1391. X{
  1392. X    perror (label);
  1393. X    exit (-1);
  1394. X}
  1395. X
  1396. Xstatic int generate_port (name)
  1397. Xchar *name;
  1398. X{
  1399. X    int port = 1;
  1400. X
  1401. X    while (*name != '\0')
  1402. X        port *= (*name++ & 0xFF);
  1403. X
  1404. X    return (port & ~0x8000) | 0x4000;
  1405. X}
  1406. X
  1407. Xstatic void setup_channel (machine, port_name)
  1408. Xchar *machine;
  1409. Xchar *port_name;
  1410. X{
  1411. X    struct hostent *hostentry;
  1412. X
  1413. X    if ((hostentry = gethostbyname (machine)) == NULL) {
  1414. X        fprintf (stderr, "%s: No such host\n", machine);
  1415. X        exit (-1);
  1416. X    }
  1417. X
  1418. X    channel.sin_family = AF_INET;
  1419. X    channel.sin_port   = htons (generate_port (port_name));
  1420. X    channel.sin_addr   = (*(struct in_addr *) hostentry->h_addr);
  1421. X}
  1422. X
  1423. Xstatic int connect_socket (machine, port_name)
  1424. Xchar *machine;
  1425. Xchar *port_name;
  1426. X{
  1427. X    int s, retries;
  1428. X
  1429. X    setup_channel (machine, port_name);
  1430. X
  1431. X    for (retries = 60; retries > 0; retries--) {
  1432. X        if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
  1433. X            perror_exit ("connect_socket: socket()");
  1434. X
  1435. X        if (connect (s, (struct sockaddr *) &channel, sizeof (channel))
  1436. X            >=0) break;
  1437. X
  1438. X        sleep (2);
  1439. X        close(s);
  1440. X    }
  1441. X
  1442. X    return retries ? s : -1;
  1443. X}
  1444. X
  1445. Xstatic int make_socket (machine, port_name)
  1446. Xchar *machine;
  1447. Xchar *port_name;
  1448. X{
  1449. X    int s, size;
  1450. X    struct sockaddr_in get_chan;
  1451. X
  1452. X    setup_channel (machine, port_name);
  1453. X
  1454. X    if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
  1455. X        perror_exit ("make_socket: socket()");
  1456. X
  1457. X    if (bind (s, (struct socketaddr *) &channel, sizeof (channel)) < 0)
  1458. X        return -1;
  1459. X
  1460. X    if (listen (s, 1) < 0)
  1461. X        perror_exit ("make_socket: listen()");
  1462. X
  1463. X    size = sizeof (get_chan);
  1464. X    if ((s = accept (s, &get_chan, &size)) < 0)
  1465. X        perror_exit ("make_socket: accept()");
  1466. X
  1467. X    return s;
  1468. X}
  1469. X
  1470. Xvoid setup_communication (name, opponent, machine)
  1471. Xchar *name, *opponent, *machine;
  1472. X{
  1473. X    struct hostent *hostentry;
  1474. X    char new_port[20];
  1475. X    int fd, cmp;
  1476. X    Boolean master;
  1477. X    char *port, *ptr;
  1478. X    time_t start;
  1479. X
  1480. X    strcpy (players[0].name, name);
  1481. X    strcpy (players[0].login, cuserid (NULL));
  1482. X
  1483. X    if (gethostname (players[0].machine, MAXHOSTNAMELEN) < 0)
  1484. X        perror_exit ("Can't find your machine name.\n");
  1485. X
  1486. X/* Strip domain name from machine name (if any) */
  1487. X    for (ptr = players[0].machine; *ptr != '\0' && *ptr != '.'; ptr++)
  1488. X        ;
  1489. X    *ptr = '\0';
  1490. X
  1491. X    if (getdomainname (players[0].domain, NAME_LENGTH) < 0)
  1492. X        perror_exit ("Can't find your domain name.\n");
  1493. X
  1494. X    if ((hostentry = gethostbyname (machine)) == NULL)
  1495. X        perror_exit ("Can't find opponents machine name.\n");
  1496. X    
  1497. X    strcpy  (players[1].login, opponent);
  1498. X    strncpy (players[1].machine, hostentry->h_name, MAXHOSTNAMELEN);
  1499. X    players[1].machine[MAXHOSTNAMELEN - 1] = '\0';
  1500. X
  1501. X/* Strip domain name from machine name (if any) */
  1502. X    for (ptr = players[1].machine; *ptr != '\0' && *ptr != '.'; ptr++)
  1503. X        ;
  1504. X    *ptr = '\0';
  1505. X
  1506. X    if ((cmp = strcmp (players[0].login, players[1].login)) == 0)
  1507. X        cmp = strcmp (players[0].machine, players[1].machine);
  1508. X
  1509. X    master  = (cmp <= 0) ? True : False;
  1510. X
  1511. X    if (master == True) {
  1512. X        machine = players[0].machine;
  1513. X        port    = players[0].login;
  1514. X
  1515. X        printf ("Waiting for response from \"%s@%s\"...",
  1516. X            players[1].login, players[1].machine);
  1517. X        fflush (stdout);
  1518. X        if ((fd = make_socket (machine, port)) < 0) {
  1519. X            if (cmp != 0)
  1520. X                perror_exit ("Cannot setup communications channel to opponent");
  1521. X            master = False;
  1522. X        }
  1523. X    }
  1524. X
  1525. X    if (master == False) {
  1526. X        machine = players[1].machine;
  1527. X        port    = players[1].login;
  1528. X
  1529. X        printf ("Connecting to \"%s@%s\"...", port, machine);
  1530. X        fflush (stdout);
  1531. X        if ((fd = connect_socket (machine, port)) < 0)
  1532. X            perror_exit ("Cannot setup communications channel to opponent");
  1533. X    }
  1534. X
  1535. X    printf ("\n\nConnected.\n");
  1536. X    fflush (stdout);
  1537. X
  1538. X    if (master == False) {
  1539. X        read_data (fd, new_port, sizeof (new_port));
  1540. X        close (fd);
  1541. X
  1542. X        start = time (NULL);
  1543. X        do {
  1544. X            fd = connect_socket (machine, new_port);
  1545. X        } while (fd == -1 && time (NULL) < start + 5);
  1546. X
  1547. X        if (fd == -1)
  1548. X            perror_exit ("Cannot reconnect to opponent");
  1549. X
  1550. X        write_player_data (fd, &players[0]);
  1551. X        read_player_data  (fd, &players[1]);
  1552. X        players[0].has_first_move = !players[1].has_first_move;
  1553. X    }
  1554. X    else {
  1555. X        sprintf (new_port, "comm%u", time(0));
  1556. X        write_data (fd, new_port, sizeof (new_port));
  1557. X        close (fd);
  1558. X
  1559. X        if ((fd = make_socket (machine, new_port)) < 0)
  1560. X            perror_exit ("Cannot recontact opponent");
  1561. X
  1562. X        srand ((time (NULL) ^ getpid ()) >> 3);
  1563. X        players[0].has_first_move = (rand () >> 4) & 0x01;
  1564. X
  1565. X        read_player_data  (fd, &players[1]);
  1566. X        write_player_data (fd, &players[0]);
  1567. X    }
  1568. X
  1569. X    players[1].fd = fd;
  1570. X
  1571. X    signal (SIGIO, SIG_IGN);
  1572. X    fcntl (fd, F_SETFL, FASYNC);
  1573. X    fcntl (fd, F_SETOWN, getpid ());
  1574. X}
  1575. X
  1576. Xstatic void read_player_data (fd, player)
  1577. Xint fd;
  1578. XPLAYER *player;
  1579. X{
  1580. X    read_data (fd, player->name,    sizeof (player->name));
  1581. X    read_data (fd, player->login,    sizeof (player->login));
  1582. X    read_data (fd, player->machine,    sizeof (player->machine));
  1583. X    read_data (fd, player->domain,    sizeof (player->domain));
  1584. X    read_data (fd, &player->has_first_move, sizeof (player->has_first_move));
  1585. X}
  1586. X
  1587. Xstatic void write_player_data (fd, player)
  1588. Xint fd;
  1589. XPLAYER *player;
  1590. X{
  1591. X    write_data (fd, player->name,     sizeof (player->name));
  1592. X    write_data (fd, player->login,     sizeof (player->login));
  1593. X    write_data (fd, player->machine, sizeof (player->machine));
  1594. X    write_data (fd, player->domain,     sizeof (player->domain));
  1595. X    write_data (fd, &player->has_first_move, sizeof(player->has_first_move));
  1596. X}
  1597. X
  1598. Xstatic void read_data (fd, output, length)
  1599. Xint fd, length;
  1600. Xchar *output;
  1601. X{
  1602. X    int bytes;
  1603. X
  1604. X    if ((bytes = read (fd, output, length)) != length) {
  1605. X        fprintf (stderr, "Read %d instead of %d bytes.\n", bytes,
  1606. X             length);
  1607. X        perror_exit ("read_data: read()");
  1608. X    }
  1609. X}
  1610. X
  1611. Xstatic void write_data (fd, input, length)
  1612. Xint fd, length;
  1613. Xchar *input;
  1614. X{
  1615. X    while (length > 0) {
  1616. X        int r, persist = 30;
  1617. X
  1618. X        while ((r = write (fd, input, length)) < 0) {
  1619. X            if (--persist == 0)
  1620. X                perror_exit ("write_data: write()");
  1621. X            sleep (2);
  1622. X        }
  1623. X        input  += r;
  1624. X        length -= r;
  1625. X    }
  1626. X}
  1627. END_OF_FILE
  1628. if test 6060 -ne `wc -c <'socket.c'`; then
  1629.     echo shar: \"'socket.c'\" unpacked with wrong size!
  1630. fi
  1631. # end of 'socket.c'
  1632. fi
  1633. if test -f 'stratego.h' -a "${1}" != "-c" ; then 
  1634.   echo shar: Will not clobber existing file \"'stratego.h'\"
  1635. else
  1636. echo shar: Extracting \"'stratego.h'\" \(2621 characters\)
  1637. sed "s/^X//" >'stratego.h' <<'END_OF_FILE'
  1638. X/*
  1639. X * Stratego.h
  1640. X */
  1641. X
  1642. X#include <stdio.h>
  1643. X#include <string.h>
  1644. X#include <sys/param.h>
  1645. X
  1646. X#include <X11/Intrinsic.h>
  1647. X#include <X11/StringDefs.h>
  1648. X#include <X11/Shell.h>
  1649. X
  1650. X#include <X11/Xaw/AsciiText.h>
  1651. X#include <X11/Xaw/Cardinals.h>
  1652. X#include <X11/Xaw/Label.h>
  1653. X#include <X11/Xaw/Command.h>
  1654. X#include <X11/Xaw/Box.h>
  1655. X#include <X11/Xaw/Form.h>
  1656. X#include <X11/Xaw/Dialog.h>
  1657. X
  1658. X#include "tiles.h"
  1659. X
  1660. X#define XDISPLAY    XtDisplay (Toplevel)
  1661. X#define XSCREEN        DefaultScreen (XDISPLAY)
  1662. X#define XROOTWINDOW    RootWindowOfScreen (XtScreen (Toplevel))
  1663. X#define XWINDOW        XtWindow (Toplevel)
  1664. Xextern XtAppContext app_con;
  1665. Xextern XtInputId EnemyID;
  1666. Xextern Widget Toplevel, Stratego, Board, Tiles, Message;
  1667. X
  1668. X/*
  1669. X * Dialog widget interface
  1670. X */
  1671. X#define ADD_CANCEL    0
  1672. X#define NO_CANCEL    1
  1673. Xextern Bool DialogBoxResult();
  1674. X
  1675. Xtypedef struct s_button {
  1676. X    char *label;
  1677. X    XtCallbackProc (*callback) ();
  1678. X    Boolean sensitive;
  1679. X    Widget widget;
  1680. X} BUTTON;
  1681. X
  1682. Xtypedef struct s_board_pos {
  1683. X    Widget widget;
  1684. X    int owner;
  1685. X    int value;
  1686. X    int y, x;
  1687. X} BOARD_POS;
  1688. X
  1689. X#define MAX_ROWS    10
  1690. X#define MAX_COLS    10
  1691. X
  1692. X#define O_NOBODY    0
  1693. X#define O_PLAYER    1
  1694. X#define O_ENEMY        2
  1695. X
  1696. Xextern BOARD_POS board[MAX_ROWS][MAX_COLS];
  1697. X
  1698. X#define DO_MOVE        0    /* Move results */
  1699. X#define UNDO_MOVE    1
  1700. X#define WIN_MOVE    2
  1701. X#define REMISE_MOVE    3
  1702. X
  1703. X/*
  1704. X * Player status.
  1705. X */
  1706. X#define PL_SETUP    0
  1707. X#define PL_SETUP_READY    1    /* Setting up board below this value */
  1708. X#define PL_READY    2
  1709. X#define PL_ENDGAME    3
  1710. X#define PL_PLAYING    4    /* Playing mode activated after this value */
  1711. X#define PL_PICKED_UP    5
  1712. X
  1713. X#define REMISE_ACCEPTED        1
  1714. X#define REMISE_DECLINED        2
  1715. X
  1716. X#define NAME_LENGTH    80
  1717. X#define LOGIN_LENGTH    10
  1718. X
  1719. Xtypedef struct s_player {
  1720. X    char name[NAME_LENGTH];
  1721. X      char login[LOGIN_LENGTH];
  1722. X      char machine[MAXHOSTNAMELEN];
  1723. X      char domain[NAME_LENGTH];
  1724. X      int fd;                /* For player to player comm. */
  1725. X    Boolean    setup_only;        /* If not playing but making board */
  1726. X    char has_first_move;        /* Only for player 0 */
  1727. X    int status;
  1728. X    int tile_select;
  1729. X    BOARD_POS *from_pos, *to_pos;    /* Move record holders */
  1730. X    TILE *to_tile;    
  1731. X    int to_owner;
  1732. X    Boolean confirm;
  1733. X} PLAYER;
  1734. X
  1735. Xextern PLAYER players[2];
  1736. X
  1737. X/*
  1738. X * Funny messages (buzz module) on illegal moves.
  1739. X */
  1740. X#include "buzz.h"
  1741. X#define display_error(table)    message (buzz (table))
  1742. X
  1743. X#define abs(x)    ((x < 0) ? -(x) : (x))
  1744. X
  1745. X/*
  1746. X * Callbacks.
  1747. X */
  1748. Xextern XtCallbackProc WipeCursor (), Clear (), Load (), Store (), Ready (),
  1749. X              Quit (), Mail ();
  1750. X#ifdef DEBUG
  1751. Xextern XtCallbackProc Debug ();
  1752. X#endif
  1753. Xextern XtCallbackProc SelectSetupBoardCursor (), ActivateBoardPosition ();
  1754. X
  1755. Xextern XtInputCallbackProc EnemyInterrupt ();
  1756. Xextern XtActionHookProc ButtonPressHook ();
  1757. X
  1758. X
  1759. Xextern void place_button_box (), message (), end_game ();
  1760. X
  1761. END_OF_FILE
  1762. if test 2621 -ne `wc -c <'stratego.h'`; then
  1763.     echo shar: \"'stratego.h'\" unpacked with wrong size!
  1764. fi
  1765. # end of 'stratego.h'
  1766. fi
  1767. echo shar: End of archive 2 \(of 4\).
  1768. cp /dev/null ark2isdone
  1769. MISSING=""
  1770. for I in 1 2 3 4 ; do
  1771.     if test ! -f ark${I}isdone ; then
  1772.     MISSING="${MISSING} ${I}"
  1773.     fi
  1774. done
  1775. if test "${MISSING}" = "" ; then
  1776.     echo You have unpacked all 4 archives.
  1777.     rm -f ark[1-9]isdone
  1778. else
  1779.     echo You still need to unpack the following archives:
  1780.     echo "        " ${MISSING}
  1781. fi
  1782. ##  End of shell archive.
  1783. exit 0
  1784.