home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / xstratgo / part04 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  12.0 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: v15i014:  xstratego - X Windows stratego interface for two players, Part04/04
  5. Message-ID: <3819@master.CNA.TEK.COM>
  6. Date: 26 Oct 92 23:52:38 GMT
  7. Article-I.D.: master.3819
  8. Sender: news@master.CNA.TEK.COM
  9. Lines: 300
  10. Approved: billr@saab.CNA.TEK.COM
  11. Xref: uunet comp.sources.games:1513
  12.  
  13. Submitted-by: Henk-Jan Visscher <hjvissc@cs.vu.nl>
  14. Posting-number: Volume 15, Issue 14
  15. Archive-name: xstratego/Part04
  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 4 (of 4)."
  27. # Contents:  Makefile buzz.h icons/account_cursor.h
  28. #   icons/account_cursor_mask.h icons/board_cursor.h
  29. #   icons/board_cursor_mask.h icons/boat_cursor.h
  30. #   icons/boat_cursor_mask.h icons/c.c icons/spy_s.h
  31. # Wrapped by billr@saab on Mon Oct 26 15:47:08 1992
  32. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  33. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'Makefile'\"
  35. else
  36. echo shar: Extracting \"'Makefile'\" \(269 characters\)
  37. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  38. XOBJS= main.o init.o callback.o dialog.o setup.o socket.o message.o play.o \
  39. X      buzz.o register.o
  40. X
  41. XCFLAGS= -O -I.
  42. X
  43. XTARGET=xstratego
  44. X
  45. XLIBS=-L/usr/lib/X11 -lXaw -lXmu -lXt -lX11 -lXext
  46. X
  47. X$(TARGET): $(OBJS)
  48. X    cc -g $(OBJS) -o $(TARGET) $(LIBS)
  49. X
  50. X$(OBJS): stratego.h buzz.h
  51. END_OF_FILE
  52. if test 269 -ne `wc -c <'Makefile'`; then
  53.     echo shar: \"'Makefile'\" unpacked with wrong size!
  54. fi
  55. # end of 'Makefile'
  56. fi
  57. if test -f 'buzz.h' -a "${1}" != "-c" ; then 
  58.   echo shar: Will not clobber existing file \"'buzz.h'\"
  59. else
  60. echo shar: Extracting \"'buzz.h'\" \(911 characters\)
  61. sed "s/^X//" >'buzz.h' <<'END_OF_FILE'
  62. X/*
  63. X * "buzz.h"
  64. X */
  65. X
  66. X/*
  67. X * Message tabel entry.  Bevat pointer naar (char) message,
  68. X * en (relatief percentage) kans op selektie.
  69. X */
  70. Xtypedef    struct {
  71. X    char      *_mesg;    /* bericht (string) */
  72. X    unsigned   _chance;    /* rel. % kans erop */
  73. X} MESSAGE;
  74. X
  75. Xextern MESSAGE    move_opponent [];    /* stuk van tegenpartij bewegen */
  76. Xextern MESSAGE    move_empty [];        /* lege plaats bewegen        */
  77. Xextern MESSAGE    move_flag [];        /* vlag bewegen            */
  78. Xextern MESSAGE    move_bomb [];        /* bom bewegen            */
  79. Xextern MESSAGE    kill_own [];        /* eigen stuk slaan        */
  80. Xextern MESSAGE    illegal [];        /* andere illegale zetten    */
  81. Xextern MESSAGE    finished_premature [];    /* voortijdige 'F'         */
  82. Xextern MESSAGE    in_water [];        /* in het water gaan staan    */
  83. Xextern MESSAGE    lose_capture [];    /* bij slaan van stuk (verloren)*/
  84. Xextern MESSAGE    win_capture [];        /* bij slaan van stuk (gewonnen)*/
  85. X
  86. X/*
  87. X * Buzz (tabel) geeft een message uit tabel terug.
  88. X */
  89. Xchar    *buzz ();
  90. END_OF_FILE
  91. if test 911 -ne `wc -c <'buzz.h'`; then
  92.     echo shar: \"'buzz.h'\" unpacked with wrong size!
  93. fi
  94. # end of 'buzz.h'
  95. fi
  96. if test -f 'icons/account_cursor.h' -a "${1}" != "-c" ; then 
  97.   echo shar: Will not clobber existing file \"'icons/account_cursor.h'\"
  98. else
  99. echo shar: Extracting \"'icons/account_cursor.h'\" \(367 characters\)
  100. sed "s/^X//" >'icons/account_cursor.h' <<'END_OF_FILE'
  101. X#define account_cursor_width 16
  102. X#define account_cursor_height 16
  103. X#define account_cursor_x_hot 7
  104. X#define account_cursor_y_hot 7
  105. Xstatic char account_cursor_bits[] = {
  106. X   0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x70, 0x0e, 0xd8, 0x1b,
  107. X   0xbc, 0x3d, 0xd6, 0x6b, 0x76, 0x6e, 0xdc, 0x3b, 0xb8, 0x1d, 0xd0, 0x0b,
  108. X   0x60, 0x06, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00};
  109. END_OF_FILE
  110. if test 367 -ne `wc -c <'icons/account_cursor.h'`; then
  111.     echo shar: \"'icons/account_cursor.h'\" unpacked with wrong size!
  112. fi
  113. # end of 'icons/account_cursor.h'
  114. fi
  115. if test -f 'icons/account_cursor_mask.h' -a "${1}" != "-c" ; then 
  116.   echo shar: Will not clobber existing file \"'icons/account_cursor_mask.h'\"
  117. else
  118. echo shar: Extracting \"'icons/account_cursor_mask.h'\" \(392 characters\)
  119. sed "s/^X//" >'icons/account_cursor_mask.h' <<'END_OF_FILE'
  120. X#define account_cursor_mask_width 16
  121. X#define account_cursor_mask_height 16
  122. X#define account_cursor_mask_x_hot 7
  123. X#define account_cursor_mask_y_hot 7
  124. Xstatic char account_cursor_mask_bits[] = {
  125. X   0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f,
  126. X   0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f,
  127. X   0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01};
  128. END_OF_FILE
  129. if test 392 -ne `wc -c <'icons/account_cursor_mask.h'`; then
  130.     echo shar: \"'icons/account_cursor_mask.h'\" unpacked with wrong size!
  131. fi
  132. # end of 'icons/account_cursor_mask.h'
  133. fi
  134. if test -f 'icons/board_cursor.h' -a "${1}" != "-c" ; then 
  135.   echo shar: Will not clobber existing file \"'icons/board_cursor.h'\"
  136. else
  137. echo shar: Extracting \"'icons/board_cursor.h'\" \(807 characters\)
  138. sed "s/^X//" >'icons/board_cursor.h' <<'END_OF_FILE'
  139. X#define board_cursor_width 26
  140. X#define board_cursor_height 26
  141. X#define board_cursor_x_hot 4
  142. X#define board_cursor_y_hot 4
  143. Xstatic char board_cursor_bits[] = {
  144. X   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
  145. X   0x00, 0xf0, 0x00, 0x00, 0x70, 0x78, 0x00, 0x00, 0x70, 0x7c, 0x00, 0x00,
  146. X   0xf8, 0x3e, 0x00, 0x00, 0xc8, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,
  147. X   0xc0, 0x1f, 0x03, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xf0, 0x7f, 0x03, 0x00,
  148. X   0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x7c, 0x00, 0x00, 0x3e, 0xec, 0x00, 0x00,
  149. X   0x0e, 0xc4, 0x03, 0x00, 0x00, 0x8e, 0x03, 0x00, 0x00, 0x8a, 0x07, 0x00,
  150. X   0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00,
  151. X   0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x01,
  152. X   0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00};
  153. END_OF_FILE
  154. if test 807 -ne `wc -c <'icons/board_cursor.h'`; then
  155.     echo shar: \"'icons/board_cursor.h'\" unpacked with wrong size!
  156. fi
  157. # end of 'icons/board_cursor.h'
  158. fi
  159. if test -f 'icons/board_cursor_mask.h' -a "${1}" != "-c" ; then 
  160.   echo shar: Will not clobber existing file \"'icons/board_cursor_mask.h'\"
  161. else
  162. echo shar: Extracting \"'icons/board_cursor_mask.h'\" \(832 characters\)
  163. sed "s/^X//" >'icons/board_cursor_mask.h' <<'END_OF_FILE'
  164. X#define board_cursor_mask_width 26
  165. X#define board_cursor_mask_height 26
  166. X#define board_cursor_mask_x_hot 4
  167. X#define board_cursor_mask_y_hot 4
  168. Xstatic char board_cursor_mask_bits[] = {
  169. X   0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00,
  170. X   0xf8, 0xf8, 0x01, 0x00, 0xf8, 0xfe, 0x01, 0x00, 0xf8, 0xff, 0x00, 0x00,
  171. X   0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00,
  172. X   0xf0, 0xff, 0x07, 0x00, 0xf8, 0xff, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00,
  173. X   0xfe, 0xff, 0x07, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x07, 0x00,
  174. X   0x7f, 0xff, 0x07, 0x00, 0x1f, 0xff, 0x0f, 0x00, 0x00, 0xdf, 0x3f, 0x00,
  175. X   0x00, 0xdf, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0x01,
  176. X   0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0x03,
  177. X   0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xc0, 0x03};
  178. END_OF_FILE
  179. if test 832 -ne `wc -c <'icons/board_cursor_mask.h'`; then
  180.     echo shar: \"'icons/board_cursor_mask.h'\" unpacked with wrong size!
  181. fi
  182. # end of 'icons/board_cursor_mask.h'
  183. fi
  184. if test -f 'icons/boat_cursor.h' -a "${1}" != "-c" ; then 
  185.   echo shar: Will not clobber existing file \"'icons/boat_cursor.h'\"
  186. else
  187. echo shar: Extracting \"'icons/boat_cursor.h'\" \(453 characters\)
  188. sed "s/^X//" >'icons/boat_cursor.h' <<'END_OF_FILE'
  189. X#define boat_cursor_width 24
  190. X#define boat_cursor_height 16
  191. X#define boat_cursor_x_hot 11
  192. X#define boat_cursor_y_hot 7
  193. Xstatic char boat_cursor_bits[] = {
  194. X   0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x40, 0x0a, 0x01, 0xe0, 0x8a, 0x03,
  195. X   0x50, 0x4a, 0x01, 0x50, 0x5c, 0x01, 0xe0, 0x8a, 0x03, 0x50, 0x4a, 0x01,
  196. X   0x50, 0x4a, 0x01, 0xe0, 0x9c, 0x73, 0x41, 0x08, 0x79, 0x46, 0x08, 0x7f,
  197. X   0xfc, 0xff, 0x7f, 0xb8, 0x6d, 0x3b, 0xf0, 0xff, 0x1f, 0xc0, 0xff, 0x07
  198. X};
  199. END_OF_FILE
  200. if test 453 -ne `wc -c <'icons/boat_cursor.h'`; then
  201.     echo shar: \"'icons/boat_cursor.h'\" unpacked with wrong size!
  202. fi
  203. # end of 'icons/boat_cursor.h'
  204. fi
  205. if test -f 'icons/boat_cursor_mask.h' -a "${1}" != "-c" ; then 
  206.   echo shar: Will not clobber existing file \"'icons/boat_cursor_mask.h'\"
  207. else
  208. echo shar: Extracting \"'icons/boat_cursor_mask.h'\" \(477 characters\)
  209. sed "s/^X//" >'icons/boat_cursor_mask.h' <<'END_OF_FILE'
  210. X#define boat_cursor_mask_width 24
  211. X#define boat_cursor_mask_height 16
  212. X#define boat_cursor_mask_x_hot 11
  213. X#define boat_cursor_mask_y_hot 7
  214. Xstatic char boat_cursor_mask_bits[] = {
  215. X   0x00, 0x1c, 0x00, 0x00, 0x1c, 0x00, 0xf0, 0x9e, 0x03, 0xf0, 0xde, 0x03,
  216. X   0xf0, 0xde, 0x03, 0xf0, 0xde, 0x03, 0xf0, 0xde, 0x03, 0xf0, 0xde, 0x03,
  217. X   0xf0, 0xde, 0xfb, 0xf1, 0xde, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  218. X   0xfe, 0xff, 0xff, 0xfc, 0xff, 0x7f, 0xf8, 0xff, 0x3f, 0xf0, 0xff, 0x1f};
  219. END_OF_FILE
  220. if test 477 -ne `wc -c <'icons/boat_cursor_mask.h'`; then
  221.     echo shar: \"'icons/boat_cursor_mask.h'\" unpacked with wrong size!
  222. fi
  223. # end of 'icons/boat_cursor_mask.h'
  224. fi
  225. if test -f 'icons/c.c' -a "${1}" != "-c" ; then 
  226.   echo shar: Will not clobber existing file \"'icons/c.c'\"
  227. else
  228. echo shar: Extracting \"'icons/c.c'\" \(426 characters\)
  229. sed "s/^X//" >'icons/c.c' <<'END_OF_FILE'
  230. X#include <stdio.h>
  231. X#include <string.h>
  232. X
  233. Xmain (argc, argv)
  234. Xint argc;
  235. Xchar *argv[];
  236. X{
  237. X    int max, cnt, c;
  238. X    char buf[100];
  239. X    char *s, *l;
  240. X    int offset, line = 0;
  241. X
  242. X    cnt = 0;
  243. X    while (gets (buf)) {
  244. X        line++;
  245. X        s = strchr (buf, '#');
  246. X        l = strrchr (buf, '#');
  247. X        offset = (s - buf) + 1 + (line & 0x01);
  248. X        if (s < l) {
  249. X            for (++s; s < l; s++) {
  250. X                if (*s == '#' && offset & 0x01)
  251. X                    *s = '-';
  252. X                offset++;
  253. X            }
  254. X        }
  255. X        puts (buf);
  256. X    }
  257. X}
  258. END_OF_FILE
  259. if test 426 -ne `wc -c <'icons/c.c'`; then
  260.     echo shar: \"'icons/c.c'\" unpacked with wrong size!
  261. fi
  262. # end of 'icons/c.c'
  263. fi
  264. if test -f 'icons/spy_s.h' -a "${1}" != "-c" ; then 
  265.   echo shar: Will not clobber existing file \"'icons/spy_s.h'\"
  266. else
  267. echo shar: Extracting \"'icons/spy_s.h'\" \(1421 characters\)
  268. sed "s/^X//" >'icons/spy_s.h' <<'END_OF_FILE'
  269. X#define spy_s_width 35
  270. X#define spy_s_height 43
  271. Xstatic char spy_s_bits[] = {
  272. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x01, 0x00, 0x00, 0xac,
  273. X   0xaa, 0x06, 0x00, 0x00, 0x55, 0x55, 0x15, 0x00, 0x00, 0xab, 0xaa, 0x1a,
  274. X   0x00, 0x00, 0x55, 0x55, 0x15, 0x00, 0x00, 0xaa, 0xaa, 0x0a, 0x00, 0x00,
  275. X   0x56, 0x55, 0x0d, 0x00, 0x00, 0xac, 0xaa, 0x06, 0x00, 0x00, 0x54, 0x55,
  276. X   0x05, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x00, 0x58, 0x55, 0x03, 0x00,
  277. X   0x00, 0x08, 0xaa, 0x02, 0x00, 0x00, 0x58, 0x54, 0x03, 0x00, 0x00, 0x84,
  278. X   0x02, 0x02, 0x00, 0x00, 0x06, 0x54, 0x03, 0x00, 0x00, 0xab, 0xaa, 0x06,
  279. X   0x00, 0x80, 0x55, 0x55, 0x0d, 0x00, 0x80, 0xaa, 0xaa, 0x1a, 0x00, 0x00,
  280. X   0x54, 0x15, 0x03, 0x00, 0x00, 0xa8, 0x82, 0x04, 0x00, 0x00, 0x58, 0x01,
  281. X   0x02, 0x00, 0x00, 0x08, 0x20, 0x02, 0x00, 0x00, 0x58, 0x14, 0x05, 0x00,
  282. X   0x00, 0x0c, 0xa2, 0x0a, 0x00, 0x00, 0x16, 0x51, 0x0d, 0x00, 0x00, 0x8a,
  283. X   0xaa, 0x1a, 0x00, 0x00, 0x16, 0x50, 0x15, 0x00, 0x00, 0x0b, 0xaa, 0x2a,
  284. X   0x00, 0x00, 0x55, 0x55, 0x35, 0x00, 0x80, 0xaa, 0xaa, 0x6a, 0x00, 0x00,
  285. X   0x56, 0x55, 0xd5, 0x00, 0x80, 0xaa, 0xaa, 0xaa, 0x00, 0x40, 0x55, 0x55,
  286. X   0x35, 0x00, 0xb0, 0xaa, 0xaa, 0x0a, 0x00, 0x58, 0x55, 0x55, 0x03, 0x00,
  287. X   0xa8, 0xaa, 0xaa, 0x00, 0x00, 0x60, 0x55, 0x55, 0x00, 0x00, 0x00, 0xab,
  288. X   0x2a, 0x00, 0x00, 0x00, 0x54, 0x0d, 0x00, 0x00, 0x00, 0xb0, 0x06, 0x00,
  289. X   0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  290. END_OF_FILE
  291. if test 1421 -ne `wc -c <'icons/spy_s.h'`; then
  292.     echo shar: \"'icons/spy_s.h'\" unpacked with wrong size!
  293. fi
  294. # end of 'icons/spy_s.h'
  295. fi
  296. echo shar: End of archive 4 \(of 4\).
  297. cp /dev/null ark4isdone
  298. MISSING=""
  299. for I in 1 2 3 4 ; do
  300.     if test ! -f ark${I}isdone ; then
  301.     MISSING="${MISSING} ${I}"
  302.     fi
  303. done
  304. if test "${MISSING}" = "" ; then
  305.     echo You have unpacked all 4 archives.
  306.     rm -f ark[1-9]isdone
  307. else
  308.     echo You still need to unpack the following archives:
  309.     echo "        " ${MISSING}
  310. fi
  311. ##  End of shell archive.
  312. exit 0
  313.