home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xtmines / part02 < prev    next >
Encoding:
Text File  |  1993-04-27  |  53.3 KB  |  1,618 lines

  1. Newsgroups: comp.sources.x
  2. From: ttsai@crhc.uiuc.edu (Timothy Tsai)
  3. Subject: v19i005:  xtmines - A game where you try to cross a minefield, Part02/02
  4. Message-ID: <1993Mar8.205837.29025@sparky.imd.sterling.com>
  5. X-Md4-Signature: 4db069b89419e65d942a22def4b3e539
  6. Date: Mon, 8 Mar 1993 20:58:37 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ttsai@crhc.uiuc.edu (Timothy Tsai)
  10. Posting-number: Volume 19, Issue 5
  11. Archive-name: xtmines/part02
  12. Environment: X11
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 2 (of 2)."
  21. # Contents:  COMPILING COPYING Imakefile Makefile Makefile.bak
  22. #   Makefile.std README event.c xtmines.c hiscore.c patchlevel.h
  23. #   xtmines.h bomb.bm bombmark.bm bombmarkwrong.bm goal.bm man.bm
  24. #   pow.bm safe.bm safewrong.bm trail.bm tstone.bm xtmines.man
  25. # Wrapped by ttsai@haydn.crhc.uiuc.edu on Fri Feb 26 12:04:56 1993
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'COMPILING' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'COMPILING'\"
  29. else
  30. echo shar: Extracting \"'COMPILING'\" \(1188 characters\)
  31. sed "s/^X//" >'COMPILING' <<'END_OF_FILE'
  32. X
  33. XThe only thing you must set before compiling is the HISCORE_FILENAME in
  34. Xhiscore.c.  Substitute the full pathname of the high scores file.
  35. X
  36. Xxtmines comes with an Imakefile, which means that compilation is as easy as
  37. Xtyping xmkmf followed by make.  However, since the compilation is
  38. Xstraightforward, you could probably compile using the Makefile that is
  39. Xprovided.
  40. X
  41. XIf you don't have usleep() on your system, then uncomment the following line in
  42. Xthe Imakefile or Makefile:
  43. X    DEFINES = -DNOUSLEEP
  44. X
  45. XIf you don't have imake on your system, then use the following Makefile:
  46. X(You might have to adjust the LIBPATH for your system.)
  47. X
  48. X-----------------------------------------------------------------
  49. X
  50. XCC = cc
  51. XLDFLAGS = -s
  52. XCDEBUGFLAGS = -O -s
  53. X#DEFINES = -DNOUSLEEP
  54. XXLIB = -lX11
  55. XLIBPATH = -L/usr/lib/X11
  56. XINCLUDEPATH = -I/usr/local/X11R5/include
  57. X
  58. XSRCS            = xtmines.c init.c play.c event.c hiscore.c
  59. XOBJS            = xtmines.o init.o play.o event.o hiscore.o
  60. X
  61. Xtmines: $(OBJS)
  62. X    $(CC) $(LDFLAGS) -o xtmines $(OBJS) $(LIBPATH) $(XLIB)
  63. X
  64. X.c.o:
  65. X    $(CC) $(CDEBUGFLAGS) $(INCLUDEPATH) $(DEFINES) -c $< 
  66. X
  67. Xtar:
  68. X    tar cvf xtmines.tar README COMPILING COPYING *ake* *.c *.h *.bm *.man
  69. X    compress xtmines.tar
  70. END_OF_FILE
  71. if test 1188 -ne `wc -c <'COMPILING'`; then
  72.     echo shar: \"'COMPILING'\" unpacked with wrong size!
  73. fi
  74. # end of 'COMPILING'
  75. fi
  76. if test -f 'COPYING' -a "${1}" != "-c" ; then 
  77.   echo shar: Will not clobber existing file \"'COPYING'\"
  78. else
  79. echo shar: Extracting \"'COPYING'\" \(333 characters\)
  80. sed "s/^X//" >'COPYING' <<'END_OF_FILE'
  81. XCOPYING POLICY
  82. X
  83. XYou may copy and modify xtmines as long as you give credit where it's due.
  84. XSpecifically, keep my name in the man pages.  If you have any comments,
  85. Xsuggestions, or bug reports, please email me at ttsai@uiuc.edu.  Also, if you
  86. Xmake any significant improvements, tell me, and I will make sure the update is
  87. Xdistributed.
  88. END_OF_FILE
  89. if test 333 -ne `wc -c <'COPYING'`; then
  90.     echo shar: \"'COPYING'\" unpacked with wrong size!
  91. fi
  92. # end of 'COPYING'
  93. fi
  94. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  95.   echo shar: Will not clobber existing file \"'Imakefile'\"
  96. else
  97. echo shar: Extracting \"'Imakefile'\" \(201 characters\)
  98. sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  99. X
  100. XLOCAL_LIBRARIES    = $(XLIB)
  101. XCDEBUGFLAGS    = -s -O
  102. X#DEFINES    = -DNOUSLEEP
  103. X
  104. XSRCS        = xtmines.c init.c play.c event.c hiscore.c
  105. XOBJS        = xtmines.o init.o play.o event.o hiscore.o
  106. X
  107. XComplexProgramTarget(xtmines)
  108. END_OF_FILE
  109. if test 201 -ne `wc -c <'Imakefile'`; then
  110.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  111. fi
  112. # end of 'Imakefile'
  113. fi
  114. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  115.   echo shar: Will not clobber existing file \"'Makefile'\"
  116. else
  117. echo shar: Extracting \"'Makefile'\" \(530 characters\)
  118. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  119. X
  120. XCC = cc
  121. XLDFLAGS = -s
  122. X#LDFLAGS = -g
  123. XCDEBUGFLAGS = -O -s
  124. X#CDEBUGFLAGS = -g
  125. X#DEFINES = -DNOUSLEEP
  126. XXLIB = -lX11
  127. XLIBPATH = -L/usr/lib/X11
  128. XINCLUDEPATH = -I/usr/local/X11R5/include
  129. X
  130. XSRCS            = xtmines.c init.c play.c event.c hiscore.c
  131. XOBJS            = xtmines.o init.o play.o event.o hiscore.o
  132. X
  133. Xtmines: $(OBJS)
  134. X    $(CC) $(LDFLAGS) -o xtmines $(OBJS) $(LIBPATH) $(XLIB)
  135. X
  136. X.c.o:
  137. X    $(CC) $(CDEBUGFLAGS) $(INCLUDEPATH) $(DEFINES) -c $< 
  138. X
  139. Xtar:
  140. X    tar cvf xtmines.tar README COMPILING COPYING *ake* *.c *.h *.bm *.man
  141. X    compress xtmines.tar
  142. END_OF_FILE
  143. if test 530 -ne `wc -c <'Makefile'`; then
  144.     echo shar: \"'Makefile'\" unpacked with wrong size!
  145. fi
  146. # end of 'Makefile'
  147. fi
  148. if test -f 'Makefile.bak' -a "${1}" != "-c" ; then 
  149.   echo shar: Will not clobber existing file \"'Makefile.bak'\"
  150. else
  151. echo shar: Extracting \"'Makefile.bak'\" \(418 characters\)
  152. sed "s/^X//" >'Makefile.bak' <<'END_OF_FILE'
  153. X
  154. XCC = cc
  155. XLDFLAGS =
  156. XCDEBUGFLAGS = -O
  157. X#DEFINES = -DNOUSLEEP
  158. XXLIB = -lX11
  159. XLIBPATH = -L/usr/lib/X11
  160. X
  161. XSRCS            = xtmines.c init.c play.c event.c hiscore.c
  162. XOBJS            = xtmines.o init.o play.o event.o hiscore.o
  163. X
  164. Xtmines: $(OBJS)
  165. X    $(CC) $(LDFLAGS) -o xtmines $(OBJS) $(LIBPATH) $(XLIB)
  166. X
  167. X.c.o:
  168. X    $(CC) $(CDEBUGFLAGS) $(DEFINES) -c $< 
  169. X
  170. Xtar:
  171. X    tar cvf xtmines.tar README *ake* *.c *.h *.bm *.man
  172. X    compress xtmines.tar
  173. END_OF_FILE
  174. if test 418 -ne `wc -c <'Makefile.bak'`; then
  175.     echo shar: \"'Makefile.bak'\" unpacked with wrong size!
  176. fi
  177. # end of 'Makefile.bak'
  178. fi
  179. if test -f 'Makefile.std' -a "${1}" != "-c" ; then 
  180.   echo shar: Will not clobber existing file \"'Makefile.std'\"
  181. else
  182. echo shar: Extracting \"'Makefile.std'\" \(512 characters\)
  183. sed "s/^X//" >'Makefile.std' <<'END_OF_FILE'
  184. X
  185. XCC = cc
  186. XLDFLAGS = -s
  187. X#LDFLAGS = -g
  188. XCDEBUGFLAGS = -O -s
  189. X#CDEBUGFLAGS = -g
  190. X#DEFINES = -DNOUSLEEP
  191. XXLIB = -lX11
  192. XLIBPATH = -L/usr/lib/X11
  193. XINCLUDEPATH = -I/usr/local/X11R5/include
  194. X
  195. XSRCS            = xtmines.c init.c play.c event.c hiscore.c
  196. XOBJS            = xtmines.o init.o play.o event.o hiscore.o
  197. X
  198. Xtmines: $(OBJS)
  199. X    $(CC) $(LDFLAGS) -o xtmines $(OBJS) $(LIBPATH) $(XLIB)
  200. X
  201. X.c.o:
  202. X    $(CC) $(CDEBUGFLAGS) $(INCLUDEPATH) $(DEFINES) -c $< 
  203. X
  204. Xtar:
  205. X    tar cvf xtmines.tar README *ake* *.c *.h *.bm *.man
  206. X    compress xtmines.tar
  207. END_OF_FILE
  208. if test 512 -ne `wc -c <'Makefile.std'`; then
  209.     echo shar: \"'Makefile.std'\" unpacked with wrong size!
  210. fi
  211. # end of 'Makefile.std'
  212. fi
  213. if test -f 'README' -a "${1}" != "-c" ; then 
  214.   echo shar: Will not clobber existing file \"'README'\"
  215. else
  216. echo shar: Extracting \"'README'\" \(776 characters\)
  217. sed "s/^X//" >'README' <<'END_OF_FILE'
  218. XDESCRIPTION OF XTMINES   by Timothy K. Tsai
  219. X
  220. Xxtmines is an X11 game.  The object of the game is to move across a grid of
  221. Xsquares representing a minefield.  In some of the squares are hidden mines.
  222. XYou will be told how many of the surrounding squares contain mines, and based
  223. Xon this information, it will usually be possible to traverse the entire
  224. Xminefield safely.  As an aid, you are given three hand grenades, which you can
  225. Xtoss onto a square.  Once a mine explodes, all adjacent mines will also
  226. Xexplode, causing a possible chain reaction.  Points are awarded if you
  227. Xsuccessfully traverse the minefield on a given level.  A high scores file is
  228. Xmaintained.
  229. X
  230. Xxtmines was written by Timothy K. Tsai.  You may copy or modify this program as
  231. Xlong as the credits are not removed.
  232. END_OF_FILE
  233. if test 776 -ne `wc -c <'README'`; then
  234.     echo shar: \"'README'\" unpacked with wrong size!
  235. fi
  236. # end of 'README'
  237. fi
  238. if test -f 'event.c' -a "${1}" != "-c" ; then 
  239.   echo shar: Will not clobber existing file \"'event.c'\"
  240. else
  241. echo shar: Extracting \"'event.c'\" \(6232 characters\)
  242. sed "s/^X//" >'event.c' <<'END_OF_FILE'
  243. X/* xtmines: game where you try to cross a minefield */
  244. X/* Written by Timothy Tsai  April 13, 1992 */
  245. X
  246. X#include "xtmines.h"
  247. X
  248. X/* handle_event: given an event, it will perform some action based on what */
  249. X/*               the event is and where is occurred;  the function is just */
  250. X/*               one big switch statement;  thus, this is the main         */
  251. X/*               contolling loop                                           */
  252. Xvoid handle_event(eventptr)
  253. XXEvent *eventptr;
  254. X{
  255. X    /* To avoid having to use eventptr, copy contents of *evenptr */
  256. X    /*    to event */
  257. X    XEvent            event=*eventptr;
  258. X
  259. X    /* Both of the following are filled in once the event.type */
  260. X    /*    has been determined */
  261. X    XButtonPressedEvent    *eventbp;
  262. X    XKeyPressedEvent    *eventkp;
  263. X
  264. X    /* Used by XLookupString;  this is used to check for control, */
  265. X    /*    shifted, or other special keys */
  266. X    KeySym            ksym;
  267. X
  268. X    /* Used by XLookupString;  this is used to check for actual */
  269. X    /*    keyboard commands not picked up by KeySym */
  270. X    char            s;
  271. X    char            str[MAXSTRLEN];
  272. X
  273. X    /* Both vx and vy are passed to setvxvy() to determine the virtual */
  274. X    /*   position of the event */
  275. X    int            vx,vy;
  276. X
  277. X          switch(event.type) {
  278. X
  279. X       case GraphicsExpose:
  280. X       case NoExpose:
  281. X        break;
  282. X       case Expose:
  283. X        refresh(); break;
  284. X
  285. X    /*---Check for button events first-----------------------------*/
  286. X
  287. X       case ButtonPress:
  288. X        eventbp = (XButtonPressedEvent *) &event;    
  289. X
  290. X        /* quit, but add and show scores first */
  291. X        if (eventbp->window==wind[quit_wind])
  292. X            show_and_add_scores();
  293. X
  294. X        /* toggle pause status */
  295. X        else if (eventbp->window==wind[pause_wind])
  296. X            do_pause();
  297. X
  298. X        /* toggle show status; showfig to showman, or vice versa */
  299. X        /* also update show_wind and man bitmap or fig */
  300. X        else if (eventbp->window==wind[show_wind]) {
  301. X           show = (show==sh_man) ? sh_fig : sh_man;
  302. X           if (show==sh_fig)
  303. X            used_showfig = TRUE;
  304. X           if (used_showfig)
  305. X            sprintf(str,"Show = *%s",
  306. X                (show==sh_man) ? "man" : "fig");
  307. X           else
  308. X            sprintf(str,"Show = %s",
  309. X                (show==sh_man) ? "man" : "fig");
  310. X           WindPrint(show_wind,str);
  311. X           draw(bm_man,manvx,manvy);
  312. X        }
  313. X
  314. X        /* throw grenade */
  315. X        else if (eventbp->window==wind[tgrenade_wind])
  316. X            throw_grenade();
  317. X
  318. X        /* surrender */
  319. X        else if (eventbp->window==wind[giveup_wind]) {
  320. X           show_all_bombs();
  321. X           dead = TRUE;
  322. X        }
  323. X
  324. X        /* toggle automark;  also update automark_wind   */
  325. X        /*    therefore, also turn off extended_automark */
  326. X        else if (eventbp->window==wind[automark_wind]) {
  327. X           automark = (automark ? FALSE : TRUE);
  328. X           sprintf(str,"Automark = %s",automark ? "on" : "off");
  329. X           WindPrint(automark_wind,str);
  330. X           if (!automark) {
  331. X            extended_automark = FALSE;
  332. X            WindPrint(eautomark_wind,"ExtAmark = off");
  333. X           }
  334. X           if (automark && (bomb_status(manvx,manvy)==0))
  335. X            mark_allaround_ok(manvx,manvy,0);
  336. X        }
  337. X
  338. X        /* toggle sanity check;  also update sanitycheck_wind */
  339. X        else if (eventbp->window==wind[sanitycheck_wind]) {
  340. X           sanity = (sanity ? FALSE : TRUE);
  341. X           if (sanity)
  342. X            used_sanity = TRUE;
  343. X           if (used_sanity)
  344. X               sprintf(str,"Sanity = *%s",sanity ? "on" : "off");
  345. X           else
  346. X               sprintf(str,"Sanity = %s",sanity ? "on" : "off");
  347. X           WindPrint(sanitycheck_wind,str);
  348. X           if (sanity)
  349. X            do_sanity_check(manvx,manvy);
  350. X        }
  351. X
  352. X        /* toggle extended automark;  also update eautomark_wind */
  353. X        else if (eventbp->window==wind[eautomark_wind]) {
  354. X           /* automark must be on for extended_automark to be on */
  355. X           if (!automark) {
  356. X            print_status("Must turn automark on first!");
  357. X            XBell(disp,0);
  358. X           }
  359. X           else if (level < MIN_EXTENDED_MARK_LEVEL) {
  360. X            sprintf(str,
  361. X                "Minimum level for extended_automark is %s",
  362. X                num_rank_to_words(MIN_EXTENDED_MARK_LEVEL));
  363. X            WindPrint(status,str);
  364. X            XBell(disp,0);
  365. X           }
  366. X           else {
  367. X            extended_automark = (extended_automark ? FALSE : TRUE);
  368. X            if (extended_automark)
  369. X                used_eautomark = TRUE;
  370. X            if (used_eautomark)
  371. X               sprintf(str,"ExtAmark = *%s",
  372. X                extended_automark ? "on" : "off");
  373. X            else
  374. X               sprintf(str,"ExtAmark = %s",
  375. X                extended_automark ? "on" : "off");
  376. X            WindPrint(eautomark_wind,str);
  377. X            if (extended_automark && (bomb_status(manvx,manvy)==0))
  378. X                mark_allaround_ok(manvx,manvy,0);
  379. X           }
  380. X        }
  381. X
  382. X        /* do refresh */
  383. X        else if (eventbp->window==wind[refresh_wind])
  384. X               refresh();
  385. X
  386. X        /* otherwise, it must be a move or mark */
  387. X        /*    BUTTON1 (left)   : move man */
  388. X        /*    BUTTON2 (middle) : mark unsafe (as bomb */
  389. X        /*    BUTTON3 (right)  : mark safe */
  390. X        /* If a mark is desired, and the square is already marked */
  391. X        /*    as the desired mark, then the square will be unmarked */
  392. X        else if (eventbp->window==field)
  393. X           if (setvxvy(eventbp->x,eventbp->y,&vx,&vy)!=OUT_OF_RANGE) {
  394. X           switch (eventbp->button) {
  395. X            case BUTTON1 :    move_man(vx,vy);
  396. X                    break;
  397. X            case BUTTON2 :    if (FIELD[vx][vy].m == fm_bomb)
  398. X                         remove_mark(vx,vy);
  399. X                    else
  400. X                         mark_bomb(vx,vy);
  401. X                    break;
  402. X            case BUTTON3 :    if (FIELD[vx][vy].m == fm_safe)
  403. X                         remove_mark(vx,vy);
  404. X                    else
  405. X                         mark_ok(vx,vy);
  406. X                    break;
  407. X            default      :    fprintf(stderr,
  408. X                        "Error: Illegal button\n");
  409. X                    exit(3);
  410. X           } /* switch */
  411. X           if (sanity)
  412. X            do_sanity_check(manvx,manvy);
  413. X           }
  414. X        break;
  415. X
  416. X    /*---Now check for keyboard events-----------------------------*/
  417. X
  418. X       case KeyPress:
  419. X        eventkp = (XKeyPressedEvent *) &event;
  420. X           XLookupString(&event,&s,1,&ksym,NULL);
  421. X           switch (ksym) {
  422. X        /* Ignore the following;  otherwise, control-l is */
  423. X        /*    interpreted as two keystrokes */
  424. X           case XK_Control_L:
  425. X           case XK_Shift_L:
  426. X           case XK_Shift_R:
  427. X           case XK_Caps_Lock:
  428. X           case XK_Meta_L:
  429. X           case XK_Meta_R:
  430. X           case XK_Alt_L:
  431. X           case XK_Alt_R:
  432. X            break;
  433. X              default:
  434. X               switch (s) {
  435. X                  case ' ':            /* refresh */
  436. X                   refresh(); break;
  437. X               case 'p':
  438. X               case 'P':
  439. X                do_pause();
  440. X                break;
  441. X               case 'q':
  442. X               case 'Q':            /* quit */
  443. X                show_and_add_scores();
  444. X               case ' ':            /* mark allaround */
  445. X                mark_allaround_ok(manvx,manvy,-1);
  446. X                if (sanity)
  447. X                    do_sanity_check(manvx,manvy);
  448. X                break;
  449. X               default:
  450. X                print_status("Illegal keyboard input");
  451. X                XBell(disp,0); break;
  452. X            } /* switch (s) */
  453. X            break;
  454. X        } /* switch (ksym) */
  455. X        break;
  456. X       default:
  457. X        fprintf(stderr,"Error: Illegal event\n");
  458. X        exit(4);
  459. X    } /* switch (event.type) */
  460. X}
  461. END_OF_FILE
  462. if test 6232 -ne `wc -c <'event.c'`; then
  463.     echo shar: \"'event.c'\" unpacked with wrong size!
  464. fi
  465. # end of 'event.c'
  466. fi
  467. if test -f 'xtmines.c' -a "${1}" != "-c" ; then 
  468.   echo shar: Will not clobber existing file \"'xtmines.c'\"
  469. else
  470. echo shar: Extracting \"'xtmines.c'\" \(3271 characters\)
  471. sed "s/^X//" >'xtmines.c' <<'END_OF_FILE'
  472. X/* xtmines: game where you try to cross a minefield */
  473. X/* Written by Timothy Tsai  April 13, 1992 */
  474. X
  475. X#include "xtmines.h"
  476. X
  477. Xint    bw = def_bw;    /* border width for all windows */
  478. Xint    x  = def_x;    /* frame x */
  479. Xint    y  = def_y;    /*       y */
  480. Xint    w  = def_w;    /*       width */
  481. Xint    h  = def_h;    /*       height */
  482. Xint    fh = def_fh;    /* field height */
  483. X
  484. Xint    num_bombs_left;
  485. Xint    num_time_left;            /* num of seconds */
  486. Xint    num_time_left_at_start;        /* num of seconds */
  487. Xint    num_score        = 0;
  488. Xint    num_grenades_left    = NUM_GRENADES_AT_START;
  489. Xint    num_tombstones        = 0;
  490. Xint    num_lives        = STARTING_NUM_LIVES;
  491. Xint    automark        = TRUE;
  492. Xint    sanity            = FALSE;
  493. Xint    extended_automark    = FALSE;
  494. Xshowtype    show        = DEF_SHOW;
  495. Xint    used_showfig;
  496. Xint    used_sanity;
  497. Xint    used_eautomark;
  498. X
  499. Xint    finished;    /* reach goal yet? */
  500. Xint    dead = FALSE;
  501. X
  502. Xint    num_bonus;
  503. Xint    pause_time;
  504. Xlong    time_at_start_of_level;    /* time at start of each level */
  505. X
  506. XDisplay        *disp;
  507. XWindow        root,frame,field,wind[NUMWINDS];
  508. Xint        screen,depth;
  509. XVisual        *visual;
  510. Xunsigned long    white,black;
  511. XFont        fonts,fontm,fontt;
  512. XXFontStruct    *fontsstruct,*fontmstruct,*fonttstruct;
  513. Xint        fontsw,fontsh,fontsa,
  514. X        fontshoww,fontshowh,fontshowa,
  515. X        fontmw,fontmh,fontma,
  516. X        fonttw,fontth,fontta;
  517. X
  518. XXColor        color[NUMCOLORS];
  519. XGC        gcs,gcm,gct;
  520. XColormap    cmap;
  521. X
  522. Xranktype    level;
  523. Xranktype    start_level=DEF_LEVEL;
  524. X
  525. Xextern int show_hiscores();
  526. Xextern void show_and_add_scores();
  527. X
  528. X
  529. Xmain(argc,argv)
  530. Xint argc;
  531. Xchar **argv;
  532. X{
  533. X    XEvent        event;
  534. X
  535. X
  536. X    printf("xtmines -- by Timothy K. Tsai (ttsai@uiuc.edu)\n");
  537. X    printf("   Version %d.%d (patchlevel %d) -- last modification on %s\n",
  538. X        MAJOR_VERSION_NUM,MINOR_VERSION_NUM,PATCHLEVEL,LAST_MOD_DATE);
  539. X
  540. X    if (argc==2) {
  541. X       if (!strcmp(argv[1],"-s")) {
  542. X        show_hiscores(NOX);
  543. X        exit(0);
  544. X       }
  545. X       else if ((argv[1][0]=='-') && (argv[1][1]=='l'))
  546. X        switch (argv[1][2]-'0') {
  547. X            case 0    : start_level = grunt; break;
  548. X            case 1    : start_level = corporal; break;
  549. X            case 2    : start_level = lieutenant; break;
  550. X            case 3    : start_level = captain; break;
  551. X            case 4    : start_level = mmajor; break;
  552. X            case 5    : start_level = general; break;
  553. X            case 6    : start_level = president; break;
  554. X            case 7    : start_level = king; break;
  555. X            case 8    : start_level = emperor; break;
  556. X            case 9    : start_level = angel; break;
  557. X            default    : fprintf(stderr,
  558. X                     "Error: Rank should be in range (0-9)\n");
  559. X                  exit(ILLEGAL_ARGUMENT);
  560. X        }
  561. X       else {
  562. X        fprintf(stderr,"   xtmines\n");
  563. X        fprintf(stderr,"      -s    show high scores list\n");
  564. X        fprintf(stderr,"      -lr   start at level r\n");
  565. X        exit(ILLEGAL_ARGUMENT);
  566. X       }
  567. X    }
  568. X    else if (argc != 1) {
  569. X        fprintf(stderr,"   xtmines\n");
  570. X        fprintf(stderr,"      -s    show high scores list\n");
  571. X        fprintf(stderr,"      -lr   start at level r\n");
  572. X        exit(ILLEGAL_ARGUMENT);
  573. X    }
  574. X
  575. X    open_display();
  576. X    load_fonts();
  577. X    create_map_frame();
  578. X    create_GC_colormap();
  579. X    set_event_masks();
  580. X
  581. X    for (level=start_level;(level<=HIGHEST_PLAYABLE_RANK) && 
  582. X    (num_lives>0);level++) {
  583. X        init_values();
  584. X
  585. X        set_field();
  586. X        show_bomb_status(manvx,manvy);
  587. X        refresh();
  588. X
  589. X        time_at_start_of_level = time(0);
  590. X
  591. X        finished = FALSE;
  592. X
  593. X        while (!finished) {
  594. X            if (XPending(disp) > 0) {
  595. X                XNextEvent(disp,&event);
  596. X                handle_event(&event);
  597. X            }
  598. X            else usleep(XPENDING_UDELAY);
  599. X            if ((!dead) && (!finished))
  600. X                dead = update_time();
  601. X        }
  602. X    }
  603. X
  604. X    show_and_add_scores();
  605. X}
  606. END_OF_FILE
  607. if test 3271 -ne `wc -c <'xtmines.c'`; then
  608.     echo shar: \"'xtmines.c'\" unpacked with wrong size!
  609. fi
  610. # end of 'xtmines.c'
  611. fi
  612. if test -f 'hiscore.c' -a "${1}" != "-c" ; then 
  613.   echo shar: Will not clobber existing file \"'hiscore.c'\"
  614. else
  615. echo shar: Extracting \"'hiscore.c'\" \(6234 characters\)
  616. sed "s/^X//" >'hiscore.c' <<'END_OF_FILE'
  617. X/* xtmines: game where you try to cross a minefield */
  618. X/* hiscore.c: */
  619. X/* Written by Timothy Tsai  April 13, 1992 */
  620. X
  621. X#include <sys/file.h>
  622. X#include <pwd.h>
  623. X#include <time.h>
  624. X#include "xtmines.h"
  625. X
  626. X#define MAXSCORES        10
  627. X#define MAX_ANGEL_STARTS    5
  628. X#define HISCORE_FILENAME    "/home/bach3/ttsai/games/xtmines/xtmines.hiscores"
  629. X
  630. Xtypedef struct {
  631. X    int        uid, score;
  632. X    ranktype    final_level,start_level;
  633. X    long        timestamp;
  634. X} score_t;
  635. X
  636. Xvoid show_final_score()
  637. X{
  638. X    printf("Your final score was %d\n",num_score);
  639. X    printf("Your final rank was %s\n",num_rank_to_words(level));
  640. X}
  641. X
  642. Xint add_hiscore()
  643. X{
  644. X    int    fd;
  645. X    score_t
  646. X        current, last, mine;
  647. X    int    occ = 0;        /* num times current user */
  648. X                    /*    is on hiscore list  */
  649. X    int    angelocc = 0;        /* num times current user is on list */
  650. X                    /*    and started on level angel */
  651. X    int    trickle = FALSE;
  652. X    int    myuid;
  653. X    int    added = FALSE;        /* current score added yet? */
  654. X
  655. X    myuid = getuid();    /* current user's uid */
  656. X    mine.uid = myuid;
  657. X    mine.score = num_score;
  658. X    mine.final_level = level;
  659. X    mine.start_level = start_level;
  660. X    mine.timestamp = time(0);
  661. X
  662. X    if ((fd=open(HISCORE_FILENAME,O_RDWR,0666)) < 0) {
  663. X       if ((fd=open(HISCORE_FILENAME,O_CREAT|O_WRONLY,0666)) < 0) {
  664. X        fprintf(stderr,"Error: Can't open %s\n",HISCORE_FILENAME);
  665. X        exit(5);
  666. X       }
  667. X       write(fd, (char *) &mine, sizeof(score_t));
  668. X       close(fd);
  669. X       return(0);
  670. X    }
  671. X
  672. X
  673. X    while (read(fd,(char *) ¤t,sizeof(score_t))==sizeof(score_t)) {
  674. X        if ((!added) && (num_score > current.score) &&
  675. X            ((angelocc < MAX_ANGEL_STARTS) ||
  676. X             (angelocc == MAX_ANGEL_STARTS) && (start_level != angel))){
  677. X        /* add to hiscore list */
  678. X            last = mine;
  679. X            trickle = TRUE;
  680. X            added = TRUE;
  681. X            occ++;
  682. X            if (mine.start_level == angel) angelocc++;
  683. X        }
  684. X        if (trickle) {
  685. X            lseek(fd, (long) -sizeof(score_t), L_INCR);
  686. X            write(fd, (char *) &last, sizeof(score_t));
  687. X            last = current;
  688. X            if (myuid == current.uid) {
  689. X                occ++;
  690. X                if (current.start_level == angel) angelocc++;
  691. X                if ((occ > MAXSCORES) ||
  692. X                    ((angelocc > MAX_ANGEL_STARTS) &&
  693. X                     (mine.start_level == angel))) {
  694. X                    trickle = FALSE;
  695. X                    if (occ > MAXSCORES) break;
  696. X                }
  697. X            }
  698. X        }
  699. X        else {
  700. X            if (myuid == current.uid) {
  701. X                occ++;
  702. X                if (current.start_level == angel) angelocc++;
  703. X                if (occ == MAXSCORES)
  704. X                    break;
  705. X            }
  706. X        }
  707. X    }
  708. X    if (trickle)
  709. X        write(fd, (char *) &last, sizeof(score_t));
  710. X    if ((!added) && (occ < MAXSCORES) && (angelocc < MAX_ANGEL_STARTS))
  711. X        write(fd, (char *) &mine, sizeof(score_t));
  712. X    close(fd);
  713. X}
  714. X
  715. X#define LINE_SEP    2    /* separation between lines in hswind */
  716. X#define LEFT_MARGIN    3    /* pixel sep from left edge of hswind */
  717. Xint show_hiscores(dox)
  718. Xint dox;    /* boolean:  do Xwindow show or just text */
  719. X{
  720. X    int    fd;
  721. X    int    lastuid = -1;
  722. X    int    i = 0;
  723. X    score_t    curscore;
  724. X    int    pcount = MAXSCORES;
  725. X    int    myuid;
  726. X    struct passwd *user;
  727. X    char    *name;
  728. X    int    lines=0,width,height;
  729. X    Window    hswind;        /* high score window */
  730. X    char    str[MAXSTRLEN];
  731. X    int    px=LEFT_MARGIN,    /* pixel positions for next line */
  732. X        py=fontmh;
  733. X    XEvent                  event;
  734. X    XButtonPressedEvent     *eventbp;
  735. X    XKeyPressedEvent        *eventkp;
  736. X    int                     wait = TRUE;
  737. X
  738. X    if ((fd=open(HISCORE_FILENAME,O_RDONLY,0666)) < 0) {
  739. X        fprintf(stderr,"Error: Can't open %s\n",HISCORE_FILENAME);
  740. X        exit(5);
  741. X    }
  742. X
  743. X    myuid = getuid();
  744. X    printf("Rank User          Score Final level  Start level  Time\n");
  745. X    lines++;
  746. X
  747. X    while (read(fd,(char *)&curscore,sizeof(score_t)) == sizeof(score_t)) {
  748. X        i++;
  749. X        if (pcount || curscore.uid == myuid) {
  750. X            if (lastuid != curscore.uid) {
  751. X                user = getpwuid(curscore.uid);
  752. X                lastuid = curscore.uid;
  753. X            }
  754. X            name = user->pw_name;
  755. X            /* no \n is needed because ctime puts one there */
  756. X            printf("%4d %-9s %9d %-11s  %-11s  %24s",
  757. X                i,name,curscore.score,
  758. X                num_rank_to_words(curscore.final_level),
  759. X                ((curscore.start_level<grunt) ||
  760. X                 (curscore.start_level>god)) ?
  761. X                " " : num_rank_to_words(curscore.start_level),
  762. X                ctime(&curscore.timestamp));
  763. X            lines++;
  764. X            if (pcount) pcount--;
  765. X        }
  766. X    }
  767. X    close(fd);
  768. X    printf("There are %d scores to date\n", i);
  769. X    lines++;
  770. X
  771. X    if (dox == NOX)
  772. X        return(SUCCESS);
  773. X
  774. X    /* create new window */
  775. X    lastuid = -1;
  776. X    i = 0;
  777. X    pcount = MAXSCORES;
  778. X    width = fontmw*40;
  779. X    height = (fontmh+LINE_SEP)*(lines+1);
  780. X    hswind = XCreateSimpleWindow(disp,frame,(w-width)/2,(h-height)/2,
  781. X        width,height,bw,black,white);
  782. X    XSelectInput(disp,hswind,KeyPressMask|ButtonPressMask);
  783. X    XMapRaised(disp,hswind);
  784. X    XSetForeground(disp,gct,color[font_color].pixel);
  785. X    XSetBackground(disp,gct,color[background_color].pixel);
  786. X    XFlush(disp);
  787. X
  788. X    /* print in new window */
  789. X    if ((fd=open(HISCORE_FILENAME,O_RDONLY,0666)) < 0) {
  790. X        fprintf(stderr,"Error: Can't open %s\n",HISCORE_FILENAME);
  791. X        exit(5);
  792. X    }
  793. X    sprintf(str,"Rank User          Score  Level");
  794. X    XDrawImageString(disp,hswind,gct,px,py,str,strlen(str));
  795. X    XFlush(disp);
  796. X    py += (fontmh + LINE_SEP);
  797. X    while (read(fd,(char *)&curscore,sizeof(score_t)) == sizeof(score_t)){
  798. X        i++;
  799. X        if (pcount || curscore.uid == myuid) {
  800. X            if (lastuid != curscore.uid) {
  801. X                user = getpwuid(curscore.uid);
  802. X                lastuid = curscore.uid;
  803. X            }
  804. X            name = user->pw_name;
  805. X            sprintf(str,"%4d %-9s %9d %s",i,name,curscore.score,
  806. X                num_rank_to_words(curscore.final_level));
  807. X            XDrawImageString(disp,hswind,gct,px,py,
  808. X                str,strlen(str));
  809. X            XFlush(disp);
  810. X            py += (fontmh + LINE_SEP);
  811. X            if (pcount) pcount--;
  812. X        }
  813. X    }
  814. X    close(fd);
  815. X    sprintf(str,"There are %d scores to date", i);
  816. X    XDrawImageString(disp,hswind,gct,px,py,str,strlen(str));
  817. X    py += (fontmh + LINE_SEP);
  818. X    sprintf(str,"Press key or click button to end");
  819. X    XDrawImageString(disp,hswind,gct,px,py,str,strlen(str));
  820. X    XFlush(disp);
  821. X
  822. X    /* Wait for keypress or button click */
  823. X    while (wait == TRUE) {
  824. X       while (!XPending(disp))
  825. X        usleep(XPENDING_UDELAY);
  826. X       XNextEvent(disp,&event);
  827. X       if (event.type==ButtonPress) {
  828. X        eventbp = (XButtonPressedEvent *) &event;
  829. X        if ((eventbp->window == hswind) ||
  830. X            (eventbp->window == field) ||
  831. X            (eventbp->window == wind[quit_wind]))
  832. X                    wait = FALSE;
  833. X       }
  834. X       else if (event.type == KeyPress) {
  835. X        eventkp = (XKeyPressedEvent *) &event;
  836. X        if ((eventkp->window == hswind) ||
  837. X            (eventkp->window == field))
  838. X            wait = FALSE;
  839. X       }
  840. X    }
  841. X
  842. X    return (SUCCESS);
  843. X}
  844. X
  845. Xvoid show_and_add_scores()
  846. X{
  847. X    show_final_score();
  848. X    add_hiscore();
  849. X    show_hiscores(DOX);
  850. X    exit(SUCCESS);
  851. X}
  852. END_OF_FILE
  853. if test 6234 -ne `wc -c <'hiscore.c'`; then
  854.     echo shar: \"'hiscore.c'\" unpacked with wrong size!
  855. fi
  856. # end of 'hiscore.c'
  857. fi
  858. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  859.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  860. else
  861. echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
  862. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  863. X#define PATCHLEVEL    1
  864. END_OF_FILE
  865. if test 21 -ne `wc -c <'patchlevel.h'`; then
  866.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  867. fi
  868. # end of 'patchlevel.h'
  869. fi
  870. if test -f 'xtmines.h' -a "${1}" != "-c" ; then 
  871.   echo shar: Will not clobber existing file \"'xtmines.h'\"
  872. else
  873. echo shar: Extracting \"'xtmines.h'\" \(6031 characters\)
  874. sed "s/^X//" >'xtmines.h' <<'END_OF_FILE'
  875. X/* xtmines: game where you try to cross a minefield */
  876. X/* Written by Timothy Tsai  April 13, 1992 */
  877. X
  878. X#define LAST_MOD_DATE        "June 19, 1992"
  879. X#define MAJOR_VERSION_NUM    1
  880. X#define MINOR_VERSION_NUM    2
  881. X
  882. X#include <stdio.h>
  883. X#include <X11/Xlib.h>
  884. X#define XK_MISCELLANY
  885. X#include <X11/keysymdef.h>
  886. X#include "patchlevel.h"
  887. X/* bitmaps */
  888. X#include "safe.bm"
  889. X#include "man.bm"
  890. X#include "bomb.bm"
  891. X#include "tstone.bm"
  892. X#include "goal.bm"
  893. X#include "trail.bm"
  894. X#include "pow.bm"
  895. X#include "bombmark.bm"
  896. X#include "safewrong.bm"
  897. X#include "bombmarkwrong.bm"
  898. X
  899. X#define FALSE        0
  900. X#define TRUE        1
  901. X
  902. X#define NUMROWS                25
  903. X#define NUMCOLS                40
  904. X#define BOMB_EXPLODE_UDELAY        10000
  905. X#define XPENDING_UDELAY            50000
  906. X#define SECONDS_PER_LEVEL        (5*60)
  907. X#define NUM_GRENADES_AT_START        3
  908. X#define    POINTS_PER_GRENADE        100
  909. X#define POINTS_PER_TOMBSTONE        200
  910. X#define POINTS_FOR_USED_SHOWFIG        50
  911. X#define PERCENT_FOR_USED_SANITY        1
  912. X#define PERCENT_FOR_USED_EAUTOMARK    10
  913. X#define GRENADE_DISTANCE        5
  914. X#define STARTING_NUM_LIVES        3
  915. X#define LOWEST_LEVEL_FOR_REWARD        lieutenant
  916. X#define LOWEST_SCORE_FOR_REWARD        3000
  917. X#define MAXLIVES            6
  918. X
  919. X#define MAXSTRLEN    200
  920. X#define BUTTON1        1    /* use mouse button 1 */
  921. X#define BUTTON2        2    /* use mouse button 2 */
  922. X#define BUTTON3        3    /* use mouse button 3 */
  923. X/* status font */
  924. X#define FONTS        "*courier-bold-r-normal--24*"
  925. X/* main font */
  926. X#define FONTM        "*courier-bold-r-normal--14*"
  927. X/* time font */
  928. X#define FONTT        "*courier-bold-r-normal--18*"
  929. X#define def_fh        NUMROWS*(man_height+1)
  930. X                    /* field height */
  931. X#define    def_bw        4           /* border width for all windows */
  932. X#define    def_x        0               /* frame x */
  933. X#define    def_y        0           /*       y */
  934. X#define    def_w        2*def_bw + NUMCOLS*(man_width+1)
  935. X                    /*       width */
  936. X#define    def_h        def_fh+140     /*       height */
  937. X
  938. Xextern int    bw;    /* border width for all windows */
  939. Xextern int    x;    /* frame x */
  940. Xextern int    y;    /*       y */
  941. Xextern int    w;    /*       width */
  942. Xextern int    h;    /*       height */
  943. Xextern int    fh;    /* field height */
  944. X
  945. Xextern int    finished;
  946. Xextern int    dead;
  947. X
  948. X#define SUCCESS            0
  949. X#define OUT_OF_RANGE        1
  950. X#define NO_MARK_TO_REMOVE    2
  951. X#define CANT_MARK        3
  952. X#define TIME_IS_OVER        TRUE
  953. X#define NO_GRENADES_LEFT    4
  954. X#define TOO_FAR_TO_TOSS_GRENADE    5
  955. X#define ILLEGAL_POSITION    6
  956. X#define SQUARE_IS_UNSAFE    7
  957. X#define CANT_EXPLODE        8
  958. X#define DIED            9
  959. X#define ILLEGAL_ARGUMENT    10
  960. X#define NOX            11
  961. X#define DOX            12
  962. X#define CHECK_FAILED        13
  963. X
  964. Xtypedef enum {bombs_left,bonus_wind,time_left,score, grenades_left,rank,
  965. X        lives_left,
  966. X        automark_wind,giveup_wind,tgrenade_wind,show_wind,quit_wind,
  967. X        refresh_wind,eautomark_wind,sanitycheck_wind,pause_wind,
  968. X        status} windtype;
  969. X#define NUM1WINDS    6    /* num of winds per row */
  970. X#define    NUMWINDS    17    /* tot num of winds */
  971. Xtypedef enum {grunt,corporal,lieutenant,captain,mmajor,general,president,
  972. X        king,emperor,angel,god} ranktype;
  973. X#define NUMRANKS        10    /* doesn't include god */
  974. X#define HIGHEST_PLAYABLE_RANK    angel
  975. X#define DEF_LEVEL    grunt
  976. Xextern ranktype    level;
  977. Xextern ranktype start_level;
  978. Xextern int num_bombs_at_start[NUMRANKS];
  979. Xextern int num_bonus;
  980. X
  981. Xextern int    num_bombs_left;
  982. Xextern int    num_time_left;        /* num of seconds */
  983. Xextern int    num_time_left_at_start;    /* num of seconds */
  984. Xextern long    time_at_start_of_level;
  985. Xextern int    num_score;
  986. Xextern int    num_grenades_left;
  987. Xextern int    num_tombstones;
  988. Xextern int    num_lives;
  989. Xextern int    automark;
  990. Xextern int    extended_automark;
  991. Xextern int    sanity;
  992. X#define MIN_EXTENDED_MARK_LEVEL        lieutenant
  993. Xextern int    pause_time;
  994. X
  995. Xextern Display        *disp;
  996. Xextern Window        root,frame,field,wind[NUMWINDS];
  997. Xextern int        screen,depth;
  998. Xextern Visual        *visual;
  999. Xextern unsigned long    white,black;
  1000. Xextern Font        fonts,fontm,fontt;
  1001. Xextern XFontStruct    *fontsstruct,*fontmstruct,*fonttstruct;
  1002. Xextern int        fontsw,fontsh,fontsa,
  1003. X            fontshoww,fontshowh,fontshowa,
  1004. X            fontmw,fontmh,fontma,
  1005. X            fonttw,fontth,fontta;
  1006. X
  1007. X#define font_color    0
  1008. X#define background_color 1
  1009. X#define field_color    2
  1010. X#define NUMCOLORS    3
  1011. X#define FONTCOLOR    "black"
  1012. X#define BACKGROUNDCOLOR    "white"
  1013. X#define FIELDCOLOR    "black"
  1014. Xextern XColor        color[NUMCOLORS];
  1015. Xextern GC        gcs,gcm,gct;
  1016. Xextern Colormap    cmap;
  1017. X
  1018. Xtypedef enum {bm_empty,bm_safe,bm_man,bm_bomb,bm_tombstone,bm_goal,
  1019. X        bm_trail,bm_pow,bm_bombmark,bm_safewrong,bm_bombmarkwrong} 
  1020. X        bmtype;
  1021. X#define NUMBITMAPS    11
  1022. Xtypedef enum {fc_empty,fc_trail,fc_man,fc_bomb,fc_tombstone,
  1023. X        fc_goal} fieldcont;
  1024. Xtypedef enum {fm_nomark,fm_safe,fm_bomb} fieldmark;
  1025. Xtypedef struct {
  1026. X        fieldcont    c;
  1027. X        fieldmark    m;
  1028. X        int        done;    /* used for mark_allaround_ok() */
  1029. X    } fieldstruct;
  1030. Xextern fieldstruct FIELD[NUMCOLS][NUMROWS];
  1031. Xtypedef enum {sh_man,sh_fig} showtype;
  1032. X#define DEF_SHOW    sh_fig
  1033. Xextern showtype show;
  1034. Xextern int used_showfig;    /* boolean: used showfig on present level? */
  1035. Xextern int used_sanity;        /* boolean: used sanity on present level? */
  1036. Xextern int used_eautomark;    /* boolean: used eautomark on present level? */
  1037. Xextern Pixmap bitmap[NUMBITMAPS];
  1038. Xextern int bmwidth[NUMBITMAPS];
  1039. Xextern int bmheight[NUMBITMAPS];
  1040. X
  1041. Xextern int manvx,manvy;        /* current virtual man position */
  1042. X
  1043. Xextern void open_display();
  1044. Xextern void load_fonts();
  1045. Xextern void create_map_frame();
  1046. Xextern void create_GC_colormap();
  1047. Xextern void set_event_masks();
  1048. Xextern void init_values();
  1049. Xextern int illegal_bomb_position();
  1050. Xextern void set_field();
  1051. X
  1052. X/* This is a kludge for system without usleep() */
  1053. X#ifdef NOUSLEEP
  1054. Xextern void usleep();
  1055. X#endif
  1056. Xextern void PrintStr();
  1057. Xextern void InvPrintStr();
  1058. Xextern void WindPrint();
  1059. Xextern char *num_rank_to_words();
  1060. Xextern char *clock_time_str();
  1061. Xextern void print_display();
  1062. Xextern void draw();
  1063. Xextern void clear();
  1064. Xextern void draw_field();
  1065. Xextern void refresh();
  1066. Xextern int setxy();
  1067. Xextern int setvxvy();
  1068. Xextern int bomb_status();
  1069. Xextern void show_bomb_status();
  1070. Xextern void show_all_bombs();
  1071. Xextern void do_promotion();
  1072. Xextern int move_man();
  1073. Xextern int remove_mark();
  1074. Xextern int mark_ok();
  1075. Xextern int mark_allaround_ok();
  1076. Xextern int mark_bomb();
  1077. Xextern void die();
  1078. Xextern int current_bonus();
  1079. Xextern int explode();
  1080. Xextern void uptdate_time();
  1081. Xextern int throw_grenade();
  1082. Xextern int update_time();
  1083. Xextern int do_sanity_check();
  1084. Xextern int do_pause();
  1085. END_OF_FILE
  1086. if test 6031 -ne `wc -c <'xtmines.h'`; then
  1087.     echo shar: \"'xtmines.h'\" unpacked with wrong size!
  1088. fi
  1089. # end of 'xtmines.h'
  1090. fi
  1091. if test -f 'bomb.bm' -a "${1}" != "-c" ; then 
  1092.   echo shar: Will not clobber existing file \"'bomb.bm'\"
  1093. else
  1094. echo shar: Extracting \"'bomb.bm'\" \(506 characters\)
  1095. sed "s/^X//" >'bomb.bm' <<'END_OF_FILE'
  1096. X#define bomb_width 23
  1097. X#define bomb_height 23
  1098. Xstatic char bomb_bits[] = {
  1099. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
  1100. X   0x00, 0x80, 0x19, 0x00, 0x5f, 0x06, 0xc0, 0x7f, 0x0c, 0xf0, 0xff, 0x09,
  1101. X   0xf0, 0xf7, 0x11, 0xf8, 0xc3, 0x0b, 0xf8, 0x83, 0x07, 0xfc, 0x0f, 0x07,
  1102. X   0xfc, 0x1f, 0x07, 0xfc, 0x3f, 0x07, 0xfc, 0xbf, 0x07, 0xfc, 0xff, 0x07,
  1103. X   0xf8, 0xff, 0x03, 0xf8, 0xff, 0x03, 0xf0, 0xff, 0x01, 0xf0, 0xff, 0x01,
  1104. X   0xc0, 0x7f, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00};
  1105. END_OF_FILE
  1106. if test 506 -ne `wc -c <'bomb.bm'`; then
  1107.     echo shar: \"'bomb.bm'\" unpacked with wrong size!
  1108. fi
  1109. # end of 'bomb.bm'
  1110. fi
  1111. if test -f 'bombmark.bm' -a "${1}" != "-c" ; then 
  1112.   echo shar: Will not clobber existing file \"'bombmark.bm'\"
  1113. else
  1114. echo shar: Extracting \"'bombmark.bm'\" \(518 characters\)
  1115. sed "s/^X//" >'bombmark.bm' <<'END_OF_FILE'
  1116. X#define bombmark_width 23
  1117. X#define bombmark_height 23
  1118. Xstatic char bombmark_bits[] = {
  1119. X   0x00, 0x00, 0x00, 0x00, 0x7f, 0x38, 0xc0, 0xff, 0x3d, 0xe0, 0xff, 0x3f,
  1120. X   0xf0, 0xc1, 0x1f, 0x78, 0x80, 0x0f, 0x3c, 0xc0, 0x1f, 0x1c, 0xe0, 0x1f,
  1121. X   0x1e, 0xf0, 0x3d, 0x0e, 0xf8, 0x38, 0x0e, 0x7c, 0x38, 0x0e, 0x3e, 0x38,
  1122. X   0x0e, 0x1f, 0x38, 0x8e, 0x0f, 0x38, 0xde, 0x07, 0x3c, 0xfc, 0x03, 0x1c,
  1123. X   0xfc, 0x01, 0x1e, 0xf8, 0x00, 0x0f, 0xfc, 0xc1, 0x07, 0xfe, 0xff, 0x03,
  1124. X   0xde, 0xff, 0x01, 0x0e, 0x7f, 0x00, 0x00, 0x00, 0x00};
  1125. END_OF_FILE
  1126. if test 518 -ne `wc -c <'bombmark.bm'`; then
  1127.     echo shar: \"'bombmark.bm'\" unpacked with wrong size!
  1128. fi
  1129. # end of 'bombmark.bm'
  1130. fi
  1131. if test -f 'bombmarkwrong.bm' -a "${1}" != "-c" ; then 
  1132.   echo shar: Will not clobber existing file \"'bombmarkwrong.bm'\"
  1133. else
  1134. echo shar: Extracting \"'bombmarkwrong.bm'\" \(533 characters\)
  1135. sed "s/^X//" >'bombmarkwrong.bm' <<'END_OF_FILE'
  1136. X#define bombmarkwrong_width 23
  1137. X#define bombmarkwrong_height 23
  1138. Xstatic char bombmarkwrong_bits[] = {
  1139. X   0xff, 0xff, 0xff, 0xff, 0x80, 0xc7, 0x3f, 0x00, 0xc2, 0x1f, 0x00, 0xc0,
  1140. X   0x0f, 0x3e, 0xe0, 0x87, 0x7f, 0xf0, 0xc3, 0x3f, 0xe0, 0xe3, 0x1f, 0xe0,
  1141. X   0xe1, 0x0f, 0xc2, 0xf1, 0x07, 0xc7, 0xf1, 0x83, 0xc7, 0xf1, 0xc1, 0xc7,
  1142. X   0xf1, 0xe0, 0xc7, 0x71, 0xf0, 0xc7, 0x21, 0xf8, 0xc3, 0x03, 0xfc, 0xe3,
  1143. X   0x03, 0xfe, 0xe1, 0x07, 0xff, 0xf0, 0x03, 0x3e, 0xf8, 0x01, 0x00, 0xfc,
  1144. X   0x21, 0x00, 0xfe, 0xf1, 0x80, 0xff, 0xff, 0xff, 0xff};
  1145. END_OF_FILE
  1146. if test 533 -ne `wc -c <'bombmarkwrong.bm'`; then
  1147.     echo shar: \"'bombmarkwrong.bm'\" unpacked with wrong size!
  1148. fi
  1149. # end of 'bombmarkwrong.bm'
  1150. fi
  1151. if test -f 'goal.bm' -a "${1}" != "-c" ; then 
  1152.   echo shar: Will not clobber existing file \"'goal.bm'\"
  1153. else
  1154. echo shar: Extracting \"'goal.bm'\" \(506 characters\)
  1155. sed "s/^X//" >'goal.bm' <<'END_OF_FILE'
  1156. X#define goal_width 23
  1157. X#define goal_height 23
  1158. Xstatic char goal_bits[] = {
  1159. X   0xff, 0xff, 0x7f, 0xab, 0x1a, 0x40, 0x55, 0xf5, 0x7f, 0xab, 0x1a, 0x40,
  1160. X   0x55, 0xf5, 0x7f, 0xab, 0x1a, 0x40, 0x55, 0xf5, 0x7f, 0xab, 0x1a, 0x40,
  1161. X   0xff, 0xff, 0x7f, 0x01, 0x00, 0x40, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x40,
  1162. X   0xff, 0xff, 0x7f, 0x01, 0x00, 0x40, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x00,
  1163. X   0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
  1164. X   0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00};
  1165. END_OF_FILE
  1166. if test 506 -ne `wc -c <'goal.bm'`; then
  1167.     echo shar: \"'goal.bm'\" unpacked with wrong size!
  1168. fi
  1169. # end of 'goal.bm'
  1170. fi
  1171. if test -f 'man.bm' -a "${1}" != "-c" ; then 
  1172.   echo shar: Will not clobber existing file \"'man.bm'\"
  1173. else
  1174. echo shar: Extracting \"'man.bm'\" \(493 characters\)
  1175. sed "s/^X//" >'man.bm' <<'END_OF_FILE'
  1176. X#define man_width 23
  1177. X#define man_height 23
  1178. X
  1179. Xstatic char man_bits[] = {
  1180. X 0x80, 0xff, 0x00, 0xc0, 0x80, 0x7d, 0x40, 0x22, 0x45, 0x40, 0x08, 0x45,
  1181. X 0x00, 0x3e, 0x44, 0x00, 0x00, 0x38, 0xc0, 0xff, 0x11, 0x40, 0x00, 0x11,
  1182. X 0x7e, 0x08, 0x2f, 0x7e, 0x00, 0x3f, 0x7e, 0x08, 0x2f, 0x4e, 0x00, 0x11,
  1183. X 0xce, 0xff, 0x11, 0xc4, 0xff, 0x11, 0xce, 0xff, 0x11, 0xd1, 0xff, 0x11,
  1184. X 0x9f, 0xf7, 0x10, 0x91, 0xf7, 0x10, 0x91, 0xf7, 0x10, 0x9f, 0xf7, 0x00,
  1185. X 0xc0, 0xf7, 0x01, 0xf0, 0xf7, 0x07, 0xf0, 0xf7, 0x07 };
  1186. END_OF_FILE
  1187. if test 493 -ne `wc -c <'man.bm'`; then
  1188.     echo shar: \"'man.bm'\" unpacked with wrong size!
  1189. fi
  1190. # end of 'man.bm'
  1191. fi
  1192. if test -f 'pow.bm' -a "${1}" != "-c" ; then 
  1193.   echo shar: Will not clobber existing file \"'pow.bm'\"
  1194. else
  1195. echo shar: Extracting \"'pow.bm'\" \(503 characters\)
  1196. sed "s/^X//" >'pow.bm' <<'END_OF_FILE'
  1197. X#define pow_width 23
  1198. X#define pow_height 23
  1199. Xstatic char pow_bits[] = {
  1200. X   0x11, 0x51, 0x46, 0x22, 0x12, 0x22, 0x44, 0x52, 0x11, 0x88, 0x54, 0x09,
  1201. X   0x80, 0x54, 0x44, 0x1f, 0x55, 0x02, 0x3f, 0x31, 0x11, 0x33, 0x9a, 0x4a,
  1202. X   0x33, 0x50, 0x78, 0x33, 0x00, 0x00, 0x3f, 0xc7, 0x36, 0x9f, 0xcf, 0x36,
  1203. X   0xc3, 0xd8, 0x36, 0xc3, 0xd8, 0x36, 0xc3, 0xd8, 0x36, 0x83, 0xcf, 0x37,
  1204. X   0x03, 0x87, 0x19, 0x20, 0x00, 0x00, 0x90, 0x52, 0x04, 0x48, 0x50, 0x09,
  1205. X   0x64, 0x50, 0x12, 0x32, 0xd1, 0x22, 0x01, 0x91, 0x44};
  1206. END_OF_FILE
  1207. if test 503 -ne `wc -c <'pow.bm'`; then
  1208.     echo shar: \"'pow.bm'\" unpacked with wrong size!
  1209. fi
  1210. # end of 'pow.bm'
  1211. fi
  1212. if test -f 'safe.bm' -a "${1}" != "-c" ; then 
  1213.   echo shar: Will not clobber existing file \"'safe.bm'\"
  1214. else
  1215. echo shar: Extracting \"'safe.bm'\" \(506 characters\)
  1216. sed "s/^X//" >'safe.bm' <<'END_OF_FILE'
  1217. X#define safe_width 23
  1218. X#define safe_height 23
  1219. Xstatic char safe_bits[] = {
  1220. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
  1221. X   0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x70,
  1222. X   0x00, 0x60, 0x38, 0x00, 0x60, 0x1c, 0xf8, 0x60, 0x0e, 0xfc, 0x61, 0x07,
  1223. X   0x06, 0xe3, 0x03, 0x03, 0xe6, 0x01, 0x03, 0xe6, 0x03, 0x03, 0x66, 0x07,
  1224. X   0x03, 0x66, 0x0e, 0x03, 0x66, 0x1c, 0x06, 0x63, 0x38, 0xfc, 0x61, 0x70,
  1225. X   0xf8, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  1226. END_OF_FILE
  1227. if test 506 -ne `wc -c <'safe.bm'`; then
  1228.     echo shar: \"'safe.bm'\" unpacked with wrong size!
  1229. fi
  1230. # end of 'safe.bm'
  1231. fi
  1232. if test -f 'safewrong.bm' -a "${1}" != "-c" ; then 
  1233.   echo shar: Will not clobber existing file \"'safewrong.bm'\"
  1234. else
  1235. echo shar: Extracting \"'safewrong.bm'\" \(521 characters\)
  1236. sed "s/^X//" >'safewrong.bm' <<'END_OF_FILE'
  1237. X#define safewrong_width 23
  1238. X#define safewrong_height 23
  1239. Xstatic char safewrong_bits[] = {
  1240. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff,
  1241. X   0xff, 0x9f, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x9f, 0x9f, 0xff, 0x9f, 0x8f,
  1242. X   0xff, 0x9f, 0xc7, 0xff, 0x9f, 0xe3, 0x07, 0x9f, 0xf1, 0x03, 0x9e, 0xf8,
  1243. X   0xf9, 0x1c, 0xfc, 0xfc, 0x19, 0xfe, 0xfc, 0x19, 0xfc, 0xfc, 0x99, 0xf8,
  1244. X   0xfc, 0x99, 0xf1, 0xfc, 0x99, 0xe3, 0xf9, 0x9c, 0xc7, 0x03, 0x9e, 0x8f,
  1245. X   0x07, 0x9f, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  1246. END_OF_FILE
  1247. if test 521 -ne `wc -c <'safewrong.bm'`; then
  1248.     echo shar: \"'safewrong.bm'\" unpacked with wrong size!
  1249. fi
  1250. # end of 'safewrong.bm'
  1251. fi
  1252. if test -f 'trail.bm' -a "${1}" != "-c" ; then 
  1253.   echo shar: Will not clobber existing file \"'trail.bm'\"
  1254. else
  1255. echo shar: Extracting \"'trail.bm'\" \(499 characters\)
  1256. sed "s/^X//" >'trail.bm' <<'END_OF_FILE'
  1257. X#define trail_width 23
  1258. X#define trail_height 23
  1259. X
  1260. Xstatic char trail_bits[] = {
  1261. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a,
  1262. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a,
  1263. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a,
  1264. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a,
  1265. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a,
  1266. X 0x55, 0x55, 0x55, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55 };
  1267. END_OF_FILE
  1268. if test 499 -ne `wc -c <'trail.bm'`; then
  1269.     echo shar: \"'trail.bm'\" unpacked with wrong size!
  1270. fi
  1271. # end of 'trail.bm'
  1272. fi
  1273. if test -f 'tstone.bm' -a "${1}" != "-c" ; then 
  1274.   echo shar: Will not clobber existing file \"'tstone.bm'\"
  1275. else
  1276. echo shar: Extracting \"'tstone.bm'\" \(502 characters\)
  1277. sed "s/^X//" >'tstone.bm' <<'END_OF_FILE'
  1278. X#define tstone_width 23
  1279. X#define tstone_height 23
  1280. X
  1281. Xstatic char tstone_bits[] = {
  1282. X 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x80, 0xff, 0x00, 0xc0, 0xff, 0x01,
  1283. X 0xe0, 0xff, 0x03, 0xe0, 0xff, 0x03, 0xf0, 0xff, 0x07, 0x30, 0x16, 0x07,
  1284. X 0xb0, 0xd5, 0x06, 0xb0, 0xd5, 0x06, 0x30, 0x16, 0x07, 0xb0, 0xd4, 0x07,
  1285. X 0xb0, 0xd5, 0x07, 0xf0, 0xff, 0x07, 0x70, 0x08, 0x07, 0x30, 0x77, 0x06,
  1286. X 0xb0, 0x80, 0x06, 0x30, 0x77, 0x06, 0xb0, 0xf7, 0x06, 0xf0, 0xc1, 0x07,
  1287. X 0xfc, 0xff, 0x1f, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00 };
  1288. END_OF_FILE
  1289. if test 502 -ne `wc -c <'tstone.bm'`; then
  1290.     echo shar: \"'tstone.bm'\" unpacked with wrong size!
  1291. fi
  1292. # end of 'tstone.bm'
  1293. fi
  1294. if test -f 'xtmines.man' -a "${1}" != "-c" ; then 
  1295.   echo shar: Will not clobber existing file \"'xtmines.man'\"
  1296. else
  1297. echo shar: Extracting \"'xtmines.man'\" \(12485 characters\)
  1298. sed "s/^X//" >'xtmines.man' <<'END_OF_FILE'
  1299. X.\" Copyright (c) 1992 Timothy K. Tsai
  1300. X.\" All rights reserved.
  1301. X.\"
  1302. X.TH XTMINES 6 "18 April 1992"
  1303. X.SH NAME
  1304. Xxtmines \- X11-based minefield game
  1305. X.SH DESCRIPTION
  1306. X.B xtmines
  1307. Xis a games that runs under X11.  To start up the game, simply type xtmines.  A
  1308. Xfew command line options are listed below under OPTIONS.
  1309. X.LP
  1310. XThe display consists of two main areas: the field at the top and the
  1311. Xinformation windows at the bottom.  The field is divided into a 40x25 grid of
  1312. Xsquares.  You are the man (indicated by the number 0) at the top-left corner.
  1313. XYour objective is to traverse the field and arrive safely at the goal (the
  1314. Xflag) at the bottom-right corner.  Along the way, hidden bombs are scattered
  1315. Xacross the field.  As you determine which squares are safe and which are
  1316. Xunsafe, you may make appropriate marks using the middle and right mouse
  1317. Xbuttons.
  1318. X.LP
  1319. XYou can only move across the field one square (horizontally, vertically, or
  1320. Xdiagonally) at a time.  You are also allowed to immediately move to any square
  1321. Xyou have previously been to (such squares will be shaded gray), or any square
  1322. Xthat you have marked as safe and which is adjacent to a square already
  1323. Xtraversed.  If you land on a square with a bomb, then you will blow up.  Any
  1324. Xbombs that are horizontally or vertically (but not diagonally) adjacent will
  1325. Xalso blow up.  This causes a possible "chain reaction" of bomb explosions.
  1326. X.LP
  1327. XTo aid your traversal of the field, you will be told how many of the adjacent
  1328. X(up to eight) squares contain bombs.  This information will usually be
  1329. Xsufficient to determine where the hidden bombs are.  Instead of having the
  1330. Xnumber of adjacent bombs shown in the square where you currently are (this
  1331. Xoption is called
  1332. X.I showfig
  1333. X) you can choose to have your current position marked by a man.  To toggle this
  1334. Xoption, click on the square labeled "Show=?".
  1335. X.LP
  1336. XAs an additional aid,
  1337. X.I sanity checking
  1338. Xis available.  This means that if you mark too many adjacent squares as being
  1339. Xeither safe or unsafe, then you will be warned.  Since, such "insane" marking
  1340. Xis the cause of many undesired explosions (especially after you have been
  1341. Xplaying for a while, and fatigue makes counting become difficult), there is a
  1342. X1% point penalty for using sanity checking on a particular level.
  1343. X.LP
  1344. X.I Automarking
  1345. Xis a feature that automatically marks all eight adjacent squares as safe if
  1346. Xthere are no bombs in those adjacent squares.  This feature has been extended
  1347. Xto be recursive (ie. if appropriate, automarking will be performed on any of
  1348. Xthe eight squares that have been marked as safe).  The 
  1349. X.I extended automarking
  1350. Xis only available starting with the level of lieutenant (otherwise, on the
  1351. Xgrunt level, the complete path from start to finish would usually be shown).
  1352. XDuring extended automarking, if any squares are found to be free of surrounding
  1353. Xbombs, then it will be shaded to mark it as though you had already traversed
  1354. Xthat square.  This will allow you to immediately skip to the "frontier" on the
  1355. Xextended automarking.  By pressing the space bar, "automarking" can be forced.
  1356. XHowever, if you do this, no check is performed to make sure that there are no
  1357. Xadjacent bombs; thus, squares could be incorrectly marked.  Extended
  1358. Xautomarking is disabled for space-bar-forced automarking.  There is a 10% point
  1359. Xpenalty for each level on which you use extended automarking.
  1360. X.LP
  1361. XYou are also given three 
  1362. X.I grenades 
  1363. Xwith which you can blow up bombs.  These grenades can only be thrown a distance
  1364. Xof five squares (count off the five squares by counting the number of
  1365. Xhorizontal and vertical moves you would have to make to go to that square).
  1366. XAgain, there is a possible chain reaction of explosions, and if you happen to
  1367. Xbe next to a square that explodes, then you will also explode.  When you
  1368. Xexplode and die, a tombstone is placed on that square, and you can no longer
  1369. Xenter that square.  There is always a guaranteed safe path from start to goal.
  1370. XThis means that it is always possible to reach the goal without removing any
  1371. Xbombs from the field by exploding them.
  1372. X.LP
  1373. XWhen you reach the goal safely (ie. with at least one life left), then you will
  1374. Xreceive points based on the time you have left, the number of bombs left
  1375. Xunexploded, the number of grenades left, the number of times you died, and
  1376. Xwhether or not you used sanity checking or extended automarking.  If your
  1377. Xcurrent rank is at least lieutenant and your current score is at least 3000,
  1378. Xthen you will receive an extra life and an extra grenade (you can have at most
  1379. Xthree grenades at the start of any level).  Also, when you reach the goal, all
  1380. Xhidden bombs will be shown.  If you have marked any squares incorrectly, then
  1381. Xthose squares will be highlighted.
  1382. X.LP
  1383. XOnce you attain the rank of angel and reach the goal as a angel, you are
  1384. Xpromoted to the rank of god, and the game ends.  Also, if you run out of time
  1385. Xor lives, the game ends.  A high scores list is implemented and is shown and
  1386. Xupdated at the end of every game.  Since very high scores can be attained by
  1387. Xsimply starting out at the angel level, a maximum of five high scores from the
  1388. Xangel starting level are permitted.  To quit the game, you must explicitly quit
  1389. X(ie. you must either click on the
  1390. X.I Quit
  1391. Xbutton or hit 'q' or 'Q').  Otherwise, you will be allowed to continue moving
  1392. Xaround on the field, being able to blow up bombs and yourself and being able to
  1393. Xthrow any remaining grenades.  The timer will stop, and you will not be able to
  1394. Xadvance to the next level or gain points.  The reason for allowing this is to
  1395. Xpermit you to analyze your position once the game ends.
  1396. X.LP
  1397. XBelow the field is a set of windows with information.
  1398. XThe topmost window below the field is the status window.  Error messages and
  1399. Xmore importantly, adjacent bomb information will be given here.  If you require
  1400. Xthe adjacent bomb information without moving, click on your current position.
  1401. X.LP
  1402. X.TP 8
  1403. XThe second row of windows contain the following info:
  1404. X.RS
  1405. X.PD 0
  1406. X.TP 18
  1407. X.I Bombs:
  1408. Xwill decrease when bombs on the field are exploded.
  1409. X.TP
  1410. X.I Bonus:
  1411. Xhow many points you would earn if you were to reach the goal at that specific
  1412. Xtime.
  1413. X.TP
  1414. X.I Time:
  1415. Xtime left before the game is over.
  1416. X.TP
  1417. X.I Score:
  1418. Xhow many points accumulated so far; points are only awarded upon reaching the
  1419. Xgoal.
  1420. X.TP
  1421. X.I Grenades:
  1422. Xhow many grenades are left.
  1423. X.TP
  1424. X.I Rank:
  1425. Xcurrent rank (determines number of bombs at start and starting time).
  1426. X.TP
  1427. X.I Lives:
  1428. Xhow many lives remaining (including the current one).  (This window is actually
  1429. Xin the third row.)
  1430. X.RE
  1431. X.PD
  1432. X.LP
  1433. XThe third row of window contain the contain buttons (which you can click on):
  1434. X.LP
  1435. X.TP 18
  1436. X.I Automark = on/off
  1437. Xtoggles automark on and off.  Automarking means that if the check for adjacent
  1438. Xbombs reveals no bombs, then all adjacent squares that can be marked as safe
  1439. Xwill be marked as safe.  This is a time-saving feature for fields with few
  1440. Xbombs.  Since most of the time, there will be no hidden bombs in adjacent
  1441. Xsquares, you will want to mark all adjacent squares as safe.  With automark=on,
  1442. Xthis will be automatically done for you.  You can force marking of all adjacent
  1443. Xsquares as safe by pressing the spacebar.  This will work regardless of what
  1444. Xautomark is set to.  If a square is already marked as dangerous, then it will
  1445. Xremain marked as dangerous.
  1446. X.TP
  1447. X.I Surrender
  1448. Xgive up on current game.  All hidden bombs will be shown.  You will be able to
  1449. Xmove around, blow up, and throw grenades, but you not cannot increase your
  1450. Xscore anymore.
  1451. X.TP
  1452. X.I Throw Grenade
  1453. Xclick to throw a grenade, and then click on the square you wish to throw the
  1454. Xgrenade on.  There is a maximum distance to the throw.  This distance is
  1455. Xcomputed by adding the minimum number of moves you would have to make to reach
  1456. Xthat square.  The current maximum throw distance is five squares.  If you
  1457. Xthrow a grenade on an empty square, any bombs (or people) on adjacent squares
  1458. Xwill also explode.
  1459. X.TP
  1460. X.I Show=?
  1461. X? will either be
  1462. X.I man
  1463. Xor
  1464. X.I fig.
  1465. XIf Show=man, then the man bitmap will be used at the current position;  if
  1466. XShow=fig, then the number of adjacent bombs will be shown at the current
  1467. Xposition.  
  1468. X.TP
  1469. X.I Quit
  1470. Xself-explanatory.  You can click here at just about any time.
  1471. X.LP
  1472. XThe fourth row of window contain the contain buttons (which you can click on):
  1473. X.LP
  1474. X.TP 18
  1475. X.I Refresh
  1476. Xforce a refresh of all windows.  This shouldn't be necessary, as most refreshes
  1477. Xshould be performed automatically.
  1478. X.TP
  1479. X.I ExtAmark
  1480. XIf ExtAmark=on, then extended automarking as described above will be
  1481. Xperformed.  You must have automark=on and be ranked at least as a lieutenant.
  1482. XSince there is a point penalty for using extended automarking on each level, if
  1483. Xyou have already used extended automarking on the current level, then an
  1484. Xasterisk will be shown after the =.  If you have already used extended
  1485. Xautomarking on a particular level, and you do not wish to use it for the next
  1486. Xlevel, make sure you turn it off before you reach the goal;  otherwise, you
  1487. Xwill still be penalized for it because you will start out using extended
  1488. Xautomarking.
  1489. X.TP
  1490. X.I Sanity
  1491. XIf Sanity=on, then sanity checking as described above is enabled.  As with
  1492. Xextended automarking, because there is a point penalty for using sanity
  1493. Xchecking, the asterisk notation is used to indicate the use of this option on
  1494. Xthe current level.  To use sanity checking you must have automark=on and be
  1495. Xranked at least as a lieutenant.
  1496. X.TP
  1497. X.I Pause/Continue
  1498. XClick on this button to pause the game (the button will then be relabeled as
  1499. XContinue).  Click on it again to continue.  During the pause, the field will be
  1500. Xcleared and the clock will be stopped.  You can also use the 'p' or 'P' keys to
  1501. Xpause and the 'c' or 'C' keys to continue.
  1502. X.RE
  1503. X.PD
  1504. X.LP
  1505. X.TP 8
  1506. XIn the field window, the following keystrokes are recognized:
  1507. X.RS
  1508. X.PD 0
  1509. X.TP 18
  1510. X.B spacebar
  1511. Xmark all surrounding squares as safe unless already marked as unsafe.  This is
  1512. Xsimilar to the automark feature, but is not automatic.  This option will
  1513. Xusually be used when you believe you have already marked all the surrounding
  1514. Xdangerous squares, and you wish to mark the remaining ones as safe.  Only the
  1515. Ximmediately surrounding squares are marked;  extended automarking is not
  1516. Xperformed.
  1517. X.TP
  1518. X.B p or P
  1519. Xpause the game.  The field will be cleared, and the clock will be stopped.  You
  1520. Xcan also click on the Pause button.
  1521. X.B c or C
  1522. Xcontinue the game after it has been paused.  You can also click on the Continue
  1523. Xbutton.
  1524. X.TP
  1525. X.B q or Q
  1526. Xquit the game.  Same as clicking on the
  1527. X.I Quit
  1528. Xbutton.
  1529. X.TP
  1530. X.B control-l
  1531. Xperform a screen refresh.
  1532. X.RE
  1533. X.PD
  1534. X.LP
  1535. X.TP 8
  1536. XIn the field window, the mouse buttons have these meanings:
  1537. X.RS
  1538. X.PD 0
  1539. X.TP 18
  1540. X.B left button
  1541. Xmoves the man to that square.  You can only move one square at a time.  You
  1542. Xcannot move to a tombstone.  When you leave a square, it is shaded to mark
  1543. Xwhere you have already been.  You can always move to any square that you have
  1544. Xalready been at, regardless of the distance.
  1545. X.TP
  1546. X.B middle button
  1547. Xwill toggle the "bomb present" marking.  This is useful as a memory aid when
  1548. Xyou believe you know where a bomb already is.  You will not be allowed to move
  1549. Xonto this square until you turn of the "bomb present" marking.
  1550. X.TP
  1551. X.B right button
  1552. Xwill toggle the "safe" marking.  Again, this is a memory aid to help you keep
  1553. Xtrack of what squares you have already determined to be safe.  Keep in mind
  1554. Xthat this designation may be erroneous.
  1555. X.br
  1556. X.ne 8
  1557. X.PD
  1558. X.SH OPTIONS
  1559. X.PD
  1560. X.LP
  1561. X.TP
  1562. X.B -s
  1563. Xshow high scores list and exit
  1564. X.TP
  1565. X.BI \-l r
  1566. Xstart at level
  1567. X.I r
  1568. X, which must be an integer from 0(grunt) to 9(angel).  The highest rank is god.
  1569. XHowever, being an xtmines god is something you have to work at.  Therefore, the
  1570. Xhighest rank you can start out at is angel.
  1571. X.SH BUGS
  1572. X.LP
  1573. XThe high scores file is not secure the way it is created.  If you don't have
  1574. Xroot privileges, you should set the set-user-id bit for the xtmines executable
  1575. Xfile by using "chmod u+s xtmines.hiscores" (without the quotes, of course).  If
  1576. Xyou do have root permissions, then you should probably place the executable in
  1577. Xthe games directory and the high scores file in the games/lib directory.  The
  1578. Xgroup for the executable should be games, and the set-group-id bit should be
  1579. Xset.
  1580. X.LP
  1581. XPlease report bugs to ttsai@uiuc.edu (Timothy Tsai).
  1582. X.SH ACKNOWLDGEMENTS
  1583. X.LP
  1584. XThe idea for xtmines came from the UNIX PC game called mines.  The high scores
  1585. Xlist functions are pretty much those used by Wayne A. Christopher in his
  1586. Xtetris game.  Thanks are also due Benjamin Tsai and Dane Dwyer for their
  1587. Xsuggestions and time spent testing out the program.
  1588. END_OF_FILE
  1589. if test 12485 -ne `wc -c <'xtmines.man'`; then
  1590.     echo shar: \"'xtmines.man'\" unpacked with wrong size!
  1591. fi
  1592. # end of 'xtmines.man'
  1593. fi
  1594. echo shar: End of archive 2 \(of 2\).
  1595. cp /dev/null ark2isdone
  1596. MISSING=""
  1597. for I in 1 2 ; do
  1598.     if test ! -f ark${I}isdone ; then
  1599.     MISSING="${MISSING} ${I}"
  1600.     fi
  1601. done
  1602. if test "${MISSING}" = "" ; then
  1603.     echo You have unpacked both archives.
  1604.     rm -f ark[1-9]isdone
  1605. else
  1606.     echo You still need to unpack the following archives:
  1607.     echo "        " ${MISSING}
  1608. fi
  1609. ##  End of shell archive.
  1610. exit 0
  1611.  
  1612. exit 0 # Just in case...
  1613. -- 
  1614.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  1615. \X/  Amiga - The only way to fly!      |
  1616.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  1617.   casual observer..."                  |
  1618.