[comp.sources.games] v06i010: ega-wanderer - wanderer 2.2 for Microport V/AT w/EGA or curses, Part02/05

games@tekred.CNA.TEK.COM (02/15/89)

Submitted by: Dave Bodenstab <att!iwsl8!imdave>
Comp.sources.games: Volume 6, Issue 10
Archive-name: ega-wanderer/Part02



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 2 (of 5)."
# Contents:  159x174.c edit.c game.c read.c
# Wrapped by billr@saab on Tue Feb 14 15:28:00 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f '159x174.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'159x174.c'\"
else
echo shar: Extracting \"'159x174.c'\" \(21921 characters\)
sed "s/^X//" >'159x174.c' <<'END_OF_FILE'
X#include "bitmap.h"
X
XBM(159,174) wanderer ={ 159, 174,
X  0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x03, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 
X  0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x80, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 
X  0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 
X  0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x03, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 
X  0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 
X  0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 
X  0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0x00, 
X  0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 
X  0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x01, 0xfe, 
X  0x0f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x1f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x03, 0xff, 
X  0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 
X  0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, 0xff, 0xff, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xc1, 0xff, 
X  0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x7f, 0xff, 0x80, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x3f, 0xff, 0x00, 
X  0x00, 0x00, 0x03, 0xff, 0xf8, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 
X  0x03, 0xff, 0xfc, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x1f, 0xe0, 0x1f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xfc, 
X  0x7c, 0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x0f, 0xe0, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x1c, 0x7f, 
X  0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe1, 
X  0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x1c, 0x7f, 0xff, 0xc0, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe3, 0xe3, 0xff, 
X  0xfe, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x1c, 0x7f, 0xff, 0xc0, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe3, 0x80, 0xff, 0xfe, 0x00, 
X  0x00, 0x00, 0x03, 0xf0, 0x1c, 0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x07, 0xe3, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x00, 
X  0x03, 0xfc, 0x7c, 0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x03, 0xe7, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x01, 0xff, 
X  0xfc, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 
X  0x01, 0xef, 0x80, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfd, 0xff, 
X  0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0xff, 
X  0xe3, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x80, 
X  0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 
X  0xf0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 
X  0x00, 0x70, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 
X  0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0xf8, 
X  0x1f, 0x80, 0x06, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 
X  0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0xc0, 
X  0x1f, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x0f, 
X  0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x0f, 0xe0, 0x3f, 0x00, 
X  0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 
X  0xf8, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x07, 0xf0, 0x7e, 0x01, 0xc0, 0x00, 
X  0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 
X  0x00, 0x00, 0x00, 0x1f, 0x83, 0xf8, 0xfc, 0x07, 0xe0, 0x00, 0x0f, 0xff, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 
X  0x00, 0x0f, 0xc1, 0xfc, 0xfc, 0x0f, 0xc0, 0x00, 0x01, 0xff, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
X  0xe0, 0xfc, 0xfc, 0x1f, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0xfc, 
X  0xfc, 0x3f, 0x01, 0xc0, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0xff, 0xe0, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x01, 0xf8, 0xfc, 0xfc, 0x7e, 
X  0x07, 0xe0, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 
X  0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0xfc, 0xfc, 0xfc, 0x7e, 0x0f, 0xc0, 
X  0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 
X  0x00, 0x07, 0xfc, 0x00, 0xfc, 0xfc, 0xfc, 0x7e, 0x1f, 0x80, 0x00, 0x1f, 
X  0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 
X  0xfe, 0x00, 0x7d, 0xfc, 0xfc, 0x7e, 0x3f, 0x00, 0x00, 0x1f, 0xc0, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 
X  0x7f, 0xfc, 0xfc, 0x7e, 0x3f, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x3f, 0xf8, 
X  0xfc, 0x7e, 0x3f, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x07, 0xff, 0x00, 
X  0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x3f, 0xf0, 0xfc, 0x7e, 
X  0x3f, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0xff, 0xff, 0xf0, 0xff, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x3f, 0xe0, 0xfc, 0x7e, 0x3f, 0x00, 
X  0x00, 0x07, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0xff, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x01, 0xf8, 0x7f, 0xe0, 0xfc, 0xfe, 0x7e, 0x00, 0x00, 0x07, 
X  0xf8, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 
X  0x00, 0xff, 0xff, 0xc0, 0xfc, 0xfe, 0x7e, 0x00, 0x00, 0x07, 0xfc, 0x7f, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x7f, 
X  0xff, 0xc0, 0xfc, 0xfe, 0x7e, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x1f, 0x80, 0x7f, 0xff, 0x80, 
X  0xfe, 0xff, 0x7e, 0x01, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xf0, 0x00, 0x00, 0x00, 0x1f, 0x80, 0x7f, 0xff, 0x80, 0xfe, 0xff, 
X  0x7e, 0x03, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 
X  0x00, 0x00, 0x00, 0x1f, 0x80, 0x7f, 0xff, 0x00, 0xfe, 0xff, 0x7e, 0x07, 
X  0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 
X  0x00, 0x3f, 0x00, 0x7f, 0xff, 0x00, 0xff, 0xff, 0xfc, 0x0f, 0xe0, 0x01, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 
X  0x80, 0xff, 0xff, 0x00, 0xff, 0xff, 0xfc, 0x1f, 0xc0, 0x00, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xff, 
X  0xff, 0x00, 0xff, 0xff, 0xf8, 0x3f, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0x00, 
X  0xff, 0xff, 0xf8, 0x7f, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x00, 0xff, 0xff, 
X  0xf8, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xf0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0xff, 0xff, 0xfd, 0xfe, 
X  0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 
X  0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x07, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 
X  0x00, 0x1f, 0xff, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x0f, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x0f, 
X  0xff, 0x00, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 
X  0xff, 0xff, 0xff, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0xff, 0xff, 
X  0xff, 0xe0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0xff, 0xff, 0xff, 0xc0, 
X  0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
X  0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x7f, 0xff, 0xff, 0x80, 0x00, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
X  0x00, 0x01, 0xff, 0x00, 0x3f, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 
X  0xff, 0x00, 0x0f, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 
X  0x07, 0xff, 0xf8, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x03, 0xff, 
X  0xc0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x03, 0xff, 0x80, 0x00, 
X  0x01, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x80, 
X  0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x03, 0xff, 0x80, 0x00, 0x01, 0xff, 
X  0xff, 0xff, 0xff, 0xe3, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 
X  0x00, 0x01, 0xff, 0x00, 0x03, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 
X  0xff, 0xe3, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x01, 
X  0xff, 0x00, 0x03, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc1, 
X  0xe0, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 
X  0x03, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x03, 0xff, 
X  0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xff, 0x00, 0x03, 0xff, 0x80, 0x00, 
X  0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 
X  0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x07, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 
X  0x00, 0x3f, 0xfe, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 
X  0xfe, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xfe, 0x00, 
X  0x03, 0xff, 0xe0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xe3, 
X  0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x03, 0xff, 
X  0xf8, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xc1, 0xff, 0xff, 
X  0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x01, 0xff, 0xfe, 0x00, 
X  0x0f, 0xff, 0xff, 0xff, 0xe7, 0x1f, 0xff, 0xc1, 0xe3, 0xff, 0xff, 0xf0, 
X  0x07, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0xff, 0xff, 0x80, 0x1f, 0xff, 
X  0xff, 0xff, 0xc7, 0x1c, 0x01, 0xc1, 0xc0, 0x0f, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xc0, 0x00, 0x00, 0x7f, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xfe, 
X  0x07, 0x1c, 0x00, 0xe1, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0x80, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xf8, 0x07, 0x1c, 
X  0x00, 0x71, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 
X  0x00, 0x1f, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xf0, 0x07, 0x1c, 0x00, 0x39, 
X  0xc0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x0f, 
X  0xff, 0xff, 0x1f, 0xff, 0xff, 0xe0, 0x07, 0x1c, 0x00, 0x1d, 0xc0, 0x00, 
X  0x7f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 
X  0xdf, 0xff, 0xff, 0xc0, 0x07, 0x1c, 0x00, 0x1d, 0xc0, 0x00, 0x7f, 0xff, 
X  0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xc0, 0x07, 0x38, 0x00, 0x0f, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xf8, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xc0, 
X  0x03, 0xf0, 0x00, 0x07, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xc0, 
X  0x00, 0x02, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x80, 0x00, 0x00, 
X  0x00, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 
X  0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 
X  0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0x80, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x03, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x07, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x3f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x0f, 
X  0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x1f, 0xff, 0xc0, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 
X  0xff, 0x80, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0x80, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 
X  0x00, 0x01, 0xdc, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 0x03, 
X  0x8e, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 0x07, 0x0e, 0x00, 
X  0x07, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x03, 0xff, 0xff, 0xf8, 0x00, 0x0e, 0x07, 0x00, 0x1f, 0xff, 
X  0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x03, 0xff, 0xff, 0xfe, 0x00, 0x1c, 0x07, 0x00, 0x7f, 0xff, 0xff, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 
X  0xff, 0xff, 0x00, 0x1c, 0x07, 0x01, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 
X  0xc0, 0x1c, 0x07, 0x07, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x1c, 
X  0x07, 0x1f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfc, 0x1e, 0x07, 0x7f, 
X  0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 
X  0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x0f, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 
X  0xff, 0xf0, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 
X  0x00, 0x0f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0x00, 0x07, 
X  0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xfe, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
X  0xff, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 
X  0x00, 0x01, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 
X  0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 
X  0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x1f, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc3, 0xc0, 0x00, 0x00, 0x3f, 0xff, 
X  0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
X  0x00, 0x00, 0x00, 0x03, 0xe3, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x00, 
X  0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x1f, 0x3e, 0x00, 0x00, 0x00, 
X  0x00, 0x01, 0xf3, 0xe0, 0x00, 0x01, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
X  0xff, 0xff, 0xc0, 0x00, 0x00, 0x1e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x01, 
X  0xf9, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 
X  0xe0, 0x00, 0x00, 0x1e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfe, 
X  0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x00, 
X  0x00, 0x3f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x00, 0x00, 0xff, 
X  0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x00, 0x0f, 0xff, 0xff, 0xc0, 
X  0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 
X  0x00, 0x00, 0xff, 0xff, 0xfe, 0x01, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 
X  0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x1f, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0xff, 0xc0, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
X  0x80, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 
X  0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 
X  0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
X  0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 
X  0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x01, 
X  0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 
X  0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 
X  0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 
X  0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, };
END_OF_FILE
if test 21921 -ne `wc -c <'159x174.c'`; then
    echo shar: \"'159x174.c'\" unpacked with wrong size!
fi
# end of '159x174.c'
fi
if test -f 'edit.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'edit.c'\"
else
echo shar: Extracting \"'edit.c'\" \(8175 characters\)
sed "s/^X//" >'edit.c' <<'END_OF_FILE'
X#include "wand_head.h"
X#ifdef	EGA
X#include "bitmap.h"
X
Xextern	bitmap	*b16x16[];
Xextern	char	*EGAaddr;
X
Xint	egaedit();
Xint	screenedit();
X#endif
X
Xextern char *playscreen();
X
Xextern int debug_disp;
Xextern char *edit_screen;
Xextern char (*screen)[ROWLEN+1+1];
X
X
Xstatic char *inst[] = { "O   Boulder",
X			"< > Arrows",
X			"^   Balloon",
X			":   Earth",
X			"!   Landmine",
X			"*   Treasure",
X			"/ \\ Deflectors",
X			"+   Cage",
X			"= # Rock",
X			"T   Teleport",
X			"A   Arrival (1 max)",
X			"X   Exit (always 1)",
X			"@   Start (always 1)",
X			"M   Big Monster (1 max)",
X			"S   Baby Monster",
X			"-   Alternative space",
X			"C   Time Capsule",
X			NULL };
X
X/* Print instructions around the screen */
Xvoid instruct()
X{
Xint loop;
Xfor(loop = 0; inst[loop] ; loop++)
X    mvaddstr(loop+1,55,inst[loop]);
Xmvaddstr(20,0,"Use wanderer keys to move. m = change no. of moves, p = play game");
Xmvaddstr(21,0,"n = play game with full screen, q = quit, x = quit without save.");
X}
X
Xvoid noins()
X{
Xint loop;
Xfor(loop =0; inst[loop] ; loop++)
X    mvaddstr(loop+1,55,"                       ");
Xmove(20,0);
Xclrtoeol();
Xmove(21,0);
Xclrtoeol();
X}
X
Xvoid edit(num,score,bell,maxmoves,keys)
Xint  num, maxmoves,
X     *bell;
Xlong *score;
Xchar keys[10];
X{
Xint  x,y,sx=0,sy=0,nosave;
X
Xfor(x=0;x<=ROWLEN;x++)
X    for(y=0;y<NOOFROWS;y++)
X	{
X        if(screen[y][x] == '@')
X	    {
X	    sx = x;
X	    sy = y;
X	    }
X        if(screen[y][x] == '-')
X        	screen[y][x] = ' ';
X        }
X
X#ifdef	EGA
Xif(EGAaddr)
X    nosave = egaedit(sx,sy,num,score,bell,maxmoves,keys);
Xelse
X#endif
X    nosave = screenedit(sx,sy,num,score,bell,maxmoves,keys);
X
Xif(! nosave)
X    {
X    for(y = 0; y<=NOOFROWS;y++) /* certain editors - eg ded - have a */
X                                /* habit of truncating trailing spaces*/
X            	    		/* so this should stop them! */
X        if(screen[y][ROWLEN-1] == ' ')
X	    screen[y][ROWLEN-1] = '-';
X    wscreen(num,maxmoves);
X    }
X
Xmove(20,0);
Xrefresh();
X}
X
X#ifdef	EGA
Xint egaedit(x,y,num,score,bell,maxmoves,keys)
Xint  num, maxmoves,
X     *bell;
Xlong *score;
Xchar keys[10];
X{
Xint  ch,quit=0,nx,ny,nosave =0;
Xchar buffer[81];
Xchar *howdead;
XBM(16,16) xmap;
Xbitmap *omap;
X
Xstart_over:
X
Xdebug_disp=1;
Xmap();
X
Xif(maxmoves != 0)
X    egaprintf(0,260,"Moves = %-5d",maxmoves);
Xelse
X    egaputs(0,260,"Unlimited moves");
X
Xegaputs(0,278,"    / \\  Deflectors       O  Boulder      T  Teleport     :  Earth");
Xegaputs(0,287,"    < >  Arrows           ^  Balloon      A  Arrival      +  Cage");
Xegaputs(0,296,"    = #  Brick/Wall       !  Landmine     X  Exit         M  Big Monster");
Xegaputs(0,305,"    C    Time capsule     *  Treasure     -  Space        S  Baby Monster");
Xegaputs(0,323,"     Use wanderer keys to move.  m = change # of moves, p = play game,");
Xegaputs(0,332,"     n = play game with full screen, q = quit, x = quit without save.");
X
X/* ACTUAL EDIT FUNCTION */
X
Xwhile(!quit)
X    {
X    invert( &xmap, omap = b16x16[ symbol(screen[y][x]) ] );
X
X    egapaint( x * xmap.x, y * xmap.y, &xmap );
X
X    ch = Getch();
X
X    nx=x;
X    ny=y;
X
X    if(ch == keys[3]||ch == keys[2]||ch == keys[1]||ch == keys[0]||ch == '\b')
X	{
X	if(ch == keys[3])
X		nx++;
X	if(ch == keys[2] || ch == '\b')
X		nx--;
X	if(ch == keys[1])
X		ny++;
X	if(ch == keys[0])
X		ny--;
X	}
X    else if(ch == 'q')
X	break;
X    else if(ch == 'x')
X	{
X	egaputs(4,341,"You will lose any changes made this session - are you sure? (y/n)");
X	ch = Getch();
X	egaclear(4,341, 639,349);
X	if(ch == 'y')
X	    {
X	    nosave = 1;
X	    break;
X	    }
X	}
X    else if(ch == 'm')          /* change to number of moves for the screen */
X	{
X	egaputs(0+30*8,     260,"How many moves for this screen? ");
X	egagets(0+30*8+32*8,260,buffer);
X	sscanf(buffer,"%d",&maxmoves);
X	if(maxmoves < 0 ) maxmoves = 0;
X	egaclear(0+30*8,260, 0+30*8+40*8,268);
X	if(maxmoves != 0)
X	    egaprintf(0,260,"Moves = %-5d",maxmoves);
X	else
X	    egaputs(0,260,"Unlimited moves");
X	}
X    else if(ch == 'p' || ch == 'n')       /* play the game (test) */
X	{
X	wscreen(num,maxmoves);
X	if(ch == 'p')
X	    debug_disp = 0;
X	*score = 0;
X	howdead = playscreen(&num,score,bell,maxmoves,keys);
X	if(howdead!=NULL)
X	    sprintf(buffer,"Killed by %-57s Hit any key",howdead);
X	else
X	    sprintf(buffer,"%-67s Hit any key", "You made it!" );
X	egaputs(4,341,buffer);
X	(void) Getch();
X	egaclear(4,341, 639,349);
X	rscreen(num,&maxmoves);
X	goto start_over;
X	}
X    else
X	{
X	if(ch >= 'a' && ch <= 'z') ch = ch - 'a' + 'A';
X	if(ch < ' ' || ch >= 127) ch = '.';  /* no ctrl codes, thankyou */
X	if(ch == '"') ch = Getch();
X	invert( &xmap, omap = b16x16[ symbol(screen[y][x]=ch) ] );
X	egapaint( x * xmap.x, y * xmap.y, &xmap );
X	nx++;
X	}
X    if(nx < 0)
X	{
X	nx = ROWLEN-1;
X	ny--;
X	}
X    if(nx >= ROWLEN)
X	{
X	nx = 0;
X	ny++;
X	}
X    if(ny < 0) ny = NOOFROWS-1;
X    if(ny >= NOOFROWS) ny = 0;
X    if(x != nx || y != ny) {
X	egapaint( x * omap->width, y * omap->height, omap );
X	x=nx;
X	y=ny;
X	}
X    }
X
Xreturn( nosave );
X}
X
X/*
X * Invert a bitmap and put a border around it
X */
Xinvert( d, s )
Xbitmap *d, *s;
X{
X    int i, x, y, border, w = (s->width + 7) / 8;
X
X    *d = *s;
X    memcpy( d->bits, s->bits, s->height * w );
X
X    for( i = 0; i < d->height * w; ++i )
X	d->bits[i] ^= 0xff;
X
X    border = 0x0101 >> (d->width & 07);
X
X    for( y = 0; y < d->height; ++y ) {
X	if ( y == 0 )
X	    for( x = 0; x < w; ++x )
X		d->bits[y * w + x] = 0xff;
X	d->bits[y * w] |= 0x80;
X	d->bits[y * w + w - 1] |= border;
X	if ( y == d->height - 1 )
X	    for( x = 0; x < w; ++x )
X		d->bits[y * w + x] = 0xff;
X	}
X}
X#endif
X
X
Xint screenedit(x,y,num,score,bell,maxmoves,keys)
Xint  num, maxmoves,
X     *bell;
Xlong *score;
Xchar keys[10];
X{
Xint  ch,quit=0,nx,ny,nosave =0;
Xchar buffer[50];
Xchar *howdead;
X
Xif(maxmoves != 0)
X    (void) sprintf(buffer,"Moves remaining = %d   ",maxmoves);
Xelse
X    (void) strcpy(buffer,"     Unlimited moves     ");
Xdebug_disp=1;
Xmap();
Xmove(18,0);
Xaddstr(buffer);
X
X/* ACTUAL EDIT FUNCTION */
X
Xinstruct();
Xwhile(!quit)
X    {
X    move(y+1,x+1);
X    refresh();
X    ch = getch();
X
X    nx=x;
X    ny=y;
X
X    if(ch == keys[3]||ch == keys[2]||ch == keys[1]||ch == keys[0]||
X       ch == KEY_RIGHT||ch == KEY_LEFT||ch == KEY_BACKSPACE||ch == KEY_DOWN||ch == KEY_UP||ch == '\b')
X	{
X	if(ch == keys[3] || ch == KEY_RIGHT)
X		nx++;
X	if(ch == keys[2] || ch == KEY_LEFT || ch == KEY_BACKSPACE || ch == '\b')
X		nx--;
X	if(ch == keys[1] || ch == KEY_DOWN)
X		ny++;
X	if(ch == keys[0] || ch == KEY_UP)
X		ny--;
X	}
X    else if(ch == 'q')
X	{
X	noins();
X	break;
X	}
X    else if(ch == 'x')
X	{
X	noins();
X	mvaddstr(20,0,"You will lose any changes made this session - are you sure? (y/n)");
X	refresh();
X	ch = getch();
X	if(ch != 'y')
X	    {
X	    noins();
X	    instruct();
X	    refresh();
X	    }
X	else
X	    {
X	    nosave = 1;
X	    addch('\n');
X	    refresh();
X	    break;
X	    }
X	}
X    else if(ch == 'm')        /* change to number of moves for the screen */
X	{
X	mvaddstr(19,0,"How many moves for this screen? :");
X	refresh();
X	echo();
X	scanw("%d",&maxmoves);
X	noecho();
X	if(maxmoves < 0 ) maxmoves = 0;
X	mvaddstr(19,0,"                                           ");
X	if(maxmoves != 0)
X	    mvprintw(18,0,"Moves remaining = %d   ",maxmoves);
X	else
X	    mvaddstr(18,0,"     Unlimited moves     ");
X	refresh();            /* for some reason, this seems to add a '.' to */
X			      /* the map... Ive no idea why yet... */
X	}
X    else if(ch == 'p' || ch == 'n')       /* play the game (test) */
X	{
X	noins();
X	wscreen(num,maxmoves);
X	if(ch == 'p')
X	    {
X	    debug_disp = 0;
X	    clear();
X	    }
X	*score = 0;
X	howdead = playscreen(&num,score,bell,maxmoves,keys);
X	if(howdead!=NULL)
X	    mvprintw(20,0,"Killed by %s",howdead);
X	else
X	    mvaddstr(20,0,"DONE!");
X	addstr("; hit any key to continue\n");
X	refresh();
X	(void) getch();
X	clear();
X	rscreen(num,&maxmoves);
X	debug_disp = 1;
X	map();
X	instruct();
X	}
X    else
X	{
X	if(ch >= 'a' && ch <= 'z') ch = ch - 'a' + 'A';
X	if(ch < ' ' || ch >= 127) ch = '.';  /* no ctrl codes, thankyou */
X	if(ch == '"') ch = getch();
X	screen[y][x] = ch;
X	mvaddch(y+1,x+1,ch);
X	nx++;
X	}
X    if(nx < 0)
X	{
X	nx = ROWLEN-1;
X	ny--;
X	}
X    if(nx >= ROWLEN)
X	{
X	nx = 0;
X	ny++;
X	}
X    if(ny < 0) ny = NOOFROWS-1;
X    if(ny >= NOOFROWS) ny = 0;
X    move(ny+1,nx+1);
X    x=nx;
X    y=ny;
X    }
X
Xnoins();
X
Xreturn( nosave );
X}
END_OF_FILE
if test 8175 -ne `wc -c <'edit.c'`; then
    echo shar: \"'edit.c'\" unpacked with wrong size!
fi
# end of 'edit.c'
fi
if test -f 'game.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'game.c'\"
else
echo shar: Extracting \"'game.c'\" \(20960 characters\)
sed "s/^X//" >'game.c' <<'END_OF_FILE'
X#include "wand_head.h"
X
X#ifdef	EGA
X#include "bitmap.h"
X
Xextern	bitmap	*b16x16[];
Xextern	bitmap	*b48x48[];
Xextern	char	*EGAaddr;
X
Xchar	*split();
X#endif
X
X#define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
X	(screen[y][x] == '@') || (screen[y][x] == '+') ||\
X	(screen[y][x] == 'S')) && (y >= 0) &&\
X	(x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
X
Xtypedef struct { int d[2]; } direction;
X
X#ifdef	LINT_ARGS	/* M001 */
Xstatic int new_direction(int, int, int, int, direction*);
X#else
Xstatic int new_direction();
X#endif
X
Xextern int jumpscreen();
Xextern int check();
Xextern void showpass();
Xextern void draw_symbol();
Xextern void display();
Xextern int fall();
Xextern void map();
Xextern void redraw_screen();
Xextern int debug_disp;
Xextern int edit_mode;
Xextern int saved_game;
Xextern char (*screen)[ROWLEN+1+1];
X
X/* Add a spirit to the chain */
X/* Maintain a doubly linked list to make reuse possible.
X   tail_of_list is *NOT* the last monster allocated, but
X   the last monster alloted to a screen.  start_of_list
X   is a dummy entry to ease processing. last_of_list
X   is the last entry allocated. */
Xstatic struct mon_rec start_of_list = {0,0,0,0,0,NULL,NULL};
X
Xstruct mon_rec *tail_of_list;
Xstruct mon_rec *last_of_list;
X
Xstruct mon_rec *make_monster(x,y)
Xint x,y;
X{
Xchar *malloc();
X#define MALLOC (struct mon_rec *)malloc(sizeof(struct mon_rec))
Xstruct mon_rec *monster;
Xif(tail_of_list->next == NULL)
X    {
X    if((last_of_list = MALLOC) == NULL)
X	return NULL;
X    tail_of_list->next = last_of_list;
X    last_of_list->prev = tail_of_list;
X    last_of_list->next = NULL;
X    }
Xmonster = tail_of_list = tail_of_list->next;
Xmonster->x = x;
Xmonster->y = y;
Xmonster->mx = 1;      /* always start moving RIGHT. (fix later)  */
Xmonster->my = 0;
Xmonster->under = ' ';
Xreturn monster;
X}
X
X/* find a monster at [y,x]; but not this_one */
X
Xstruct mon_rec *monster_at_xy( x, y, this_one )
Xstruct mon_rec *this_one;
X{
Xstruct mon_rec *mp;
Xmp = &start_of_list;
Xwhile( mp != tail_of_list )
X    {
X    mp = mp->next;
X    if(mp->x == x && mp->y == y)
X	if(mp != this_one)
X	    return mp;
X    }
Xreturn NULL;
X}
X
X/* escape from a monster (only possible when debugging) */
X
Xreset_under( x, y )
X{
Xstruct mon_rec *mp;
Xmp = &start_of_list;
Xwhile( mp != tail_of_list )
X    {
X    mp = mp->next;
X    if(mp->x == x && mp->y == y)
X	mp->under = ' ';
X    }
X}
X
X/* 'follow lefthand wall' algorithm for baby monsters */
X
Xstatic int new_direction(x,y,bx,by,out)
Xint x,y,bx,by;
Xdirection *out;
X{
Xif(viable((x+by),(y-bx)))
X    {
X    out->d[0] = by;
X    out->d[1] = -bx;
X    return 1;
X    }
Xif(viable((x+bx),(y+by)))
X    {
X    out->d[0] = bx;
X    out->d[1] = by;
X    return 1;
X    }
Xif(viable((x-by),(y+bx)))
X    {
X    out->d[0] = -by;
X    out->d[1] = bx;
X    return 1;
X    }
Xif(viable((x-bx),(y-by)))
X    {
X    out->d[0] = -bx;
X    out->d[1] = -by;
X    return 1;
X    }
Xout->d[0] =
Xout->d[1] = 0;
Xreturn 0;
X}
X
X/* Actual game function -
X	Calls fall() to move boulders and arrows recursively */
X/* Variable explaination :
X    All the var names make sense to ME, but some people think them a
X    bit confusing... :-)  So heres an explanation:
X	x,y : where you are
X	nx,ny : where you're trying to move to
X	sx,sy : where the screen window on the playing area is
X	mx,my : where the monster is
X	tx,ty : teleport arrival
X	lx,ly : the place you left when teleporting
X	nf : how many diamonds youve got so far
X	new_disp : the vector the baby monster is trying
X*/
X
Xchar *playscreen(num,score,bell,maxmoves,keys)
Xint  *num, maxmoves, *bell;
Xlong *score;
Xchar keys[10];
X{
Xint  x,y,nx,ny,deadyet =0,
X     sx = -1,sy = -1,tx = -1,ty = -1,lx,ly,mx = -1,my = -1,
X     tmpx,tmpy, ch, newnum,
X     max_score = 250,
X     diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
Xstatic char     howdead[25];	/* M001 can't use auto var for return value */
Xdirection new_disp;
Xstruct mon_rec *monster,*current,*mp;
Xstruct { int x,y,c; } redraw;
X
Xtail_of_list = &start_of_list;
X
Xfor(x=0;x<=ROWLEN;x++)
X    for(y=0;y<NOOFROWS;y++)
X    {
X    if((screen[y][x] == '*')||(screen[y][x] == '+'))
X	{
X	diamonds++;
X	max_score += 10;
X	if(screen[y][x] == '+')
X	    max_score += 20;
X	}
X    if(screen[y][x] == 'A')     /* note teleport arrival point &  */
X	{                       /* replace with space */
X	tx = x;
X	ty = y;
X	screen[y][x] = ' ';
X	}
X    if(screen[y][x] == '@')
X	{
X	sx = x;
X	sy = y;
X	}
X    if(screen[y][x] == 'M')     /* Put megamonster in */
X	{
X	mx = x;
X	my = y;
X	}
X    if(screen[y][x] == 'S')     /* link small monster to pointer chain */
X	{
X	if((monster = make_monster(x,y)) == NULL)
X	    return "running out of memory";
X	if(!viable(x,y-1))     /* make sure its running in the correct */
X	    {                  /* direction..                          */
X	    monster->mx = 1;
X	    monster->my = 0;
X	    }
X	else if(!viable(x+1,y))
X	    {
X	    monster->mx = 0;
X	    monster->my = 1;
X	    }
X	else if(!viable(x,y+1))
X	    {
X	    monster->mx = -1;
X	    monster->my = 0;
X	    }
X	else if(!viable(x-1,y))
X	    {
X	    monster->mx = 0;
X	    monster->my = -1;
X	    }
X	}
X    if(screen[y][x] == '-')
X	screen[y][x] = ' ';
X    }
Xx=sx;
Xy=sy;
Xif((x == -1)&&(y == -1))              /* no start position in screen ? */
X    return "a screen design error";
X
Xupdate_game:	/* M002  restored game restarts here	*/
X
Xredraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X
Xredraw.c = 0;
X
X/* ACTUAL GAME FUNCTION - Returns method of death in string  */
Xwhile(deadyet == 0)
X{
Xch = getch();
X
Xnx=x;
Xny=y;
X
Xif((ch == keys[3] || ch == KEY_RIGHT) && (x <(ROWLEN-1)))  /* move about - but thats obvious */
X    nx++;
Xif((ch == keys[2] || ch == KEY_LEFT || ch == KEY_BACKSPACE || ch == '\b') && (x > 0))
X    nx--;
Xif((ch == keys[1] || ch == KEY_DOWN) && (y <(NOOFROWS-1)))
X    ny++;
Xif((ch == keys[0] || ch == KEY_UP) && (y > 0))
X    ny--;
Xif(ch == '1')                  /* Add or get rid of that awful sound */
X    {
X    *bell = 1;
X    beep();
X#ifdef	EGA
X    if(EGAaddr) {
X	if(debug_disp)
X	    egaputs( 4+28*8,306, "      Bell ON " );
X	else
X	    egaputs( 540,104, "Bell ON " );
X	}
X    else
X#endif
X	{
X	move(10,45);
X	(void) addstr("Bell ON ");
X	move(16,0);
X	refresh();
X	}
X    continue;
X    }
Xif(ch == '0')
X    {
X    *bell = 0;
X#ifdef	EGA
X    if(EGAaddr) {
X	if(debug_disp)
X	    egaputs( 4+28*8,306, "      Bell OFF" );
X	else
X	    egaputs( 540,104, "Bell OFF" );
X	}
X    else
X#endif
X	{
X	move(10,45);
X	(void) addstr("Bell OFF");
X	move(16,0);
X	refresh();
X	}
X    continue;
X    }
Xif(ch == '~' && !edit_mode)        /* level jump */
X    {
X    if((newnum = jumpscreen(*num)) == 0)
X	return "a jump error";
X    if(newnum != *num)
X	{                  /* Sorry Greg, no points for free */
X	sprintf(howdead,"~%c",newnum);
X	return howdead;
X	}
X    beep();
X    continue;
X    }
Xif(ch == '!' || ch == 'v')         /* look at the map */
X    {
X    if(debug_disp)
X	continue;
X#ifdef	EGA
X    if(EGAaddr) {
X	map();
X	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X	}
X    else
X#endif
X	{
X	map();
X	display(sx,sy);
X	}
X    continue;
X    }
Xif(ch == 'q')
X    return "quitting the game";
Xif(ch == '?')
X    {
X    helpme(keys);
X#ifdef	EGA
X    if(EGAaddr)
X	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X    else
X#endif
X	if(debug_disp)
X	    map();
X	else
X	    display(sx,sy);
X    continue;
X    }
Xif((ch == '@')&&(!debug_disp))
X    {
X    sx = x;
X    sy = y;
X    display(sx,sy);
X    continue;
X    }
Xif(ch == '#')
X    {
X    debug_disp = 1 - debug_disp;
X    sx = x; sy = y;
X#ifdef	EGA
X    if(EGAaddr)
X	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X    else
X#endif
X	if(debug_disp)
X	    map();
X	else
X	    {
X	    for(tmpy=0;tmpy<=(NOOFROWS+1);tmpy++)
X		{
X		move(tmpy,0);
X		for(tmpx=0;tmpx<=(ROWLEN+2);tmpx++)
X		    addch(' ');
X		}
X	    display(sx,sy);
X	    }
X    continue;
X    }
Xif(ch == 'W' || ch == '\f')                     /* redraw screen */
X    {
X    redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X    continue;
X    }
X
X/* M002  Added save/restore game feature.  Gregory H. Margo	*/
Xif(ch == 'S')           /* save game */
X    {
X    extern	struct	save_vars	zz;
X
X    /* stuff away important local variables to be saved */
X    /* so the game state may be acurately restored	*/
X    zz.z_x		= x;
X    zz.z_y		= y;
X    zz.z_tx		= tx;
X    zz.z_ty		= ty;
X    zz.z_mx		= mx;
X    zz.z_my		= my;
X    zz.z_max_score	= max_score;
X    zz.z_diamonds	= diamonds;
X    zz.z_nf		= nf;
X
X    save_game(*num,score,bell,maxmoves,&start_of_list,tail_of_list);
X
X    /* must have had an error saving game */
X#ifdef	EGA
X    if(EGAaddr) {
X	egaputs(4,341,"Hit any key to continue");
X	(void) Getch();
X	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X	}
X    else
X#endif
X	{
X	mvaddstr(LINES - 1, 0, "Type any character to continue");
X	refresh();
X	(void) getch();
X	move(LINES - 3, 0);
X	clrtobot();
X	move(16,0);
X	refresh();
X	}
X    continue;
X    }
Xif(ch == 'R')    	/* restore game */
X    {
X    extern	struct	save_vars	zz;
X
X    if (!restore_game(num,score,bell,&maxmoves,&start_of_list,&tail_of_list))
X	{
X#ifdef	EGA
X	if(EGAaddr) {
X	    egaputs(4,341,"Hit any key to continue");
X	    (void) Getch();
X	    redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X	    }
X	else
X#endif
X	    {
X	    mvaddstr(LINES - 1, 0, "Type any character to continue");
X	    refresh();
X	    (void) getch();
X	    move(LINES - 3, 0);
X	    clrtobot();
X	    move(16,0);
X	    refresh();
X	    }
X	continue;
X	}
X
X    /* recover important local variables */
X    sx		=
X    x		= zz.z_x;
X    if(sx < 4) sx = 4; else if(sx>(ROWLEN -5)) sx = ROWLEN -5;
X    sy		=
X    y		= zz.z_y;
X    if(sy < 2) sy = 2; else if(sy > (NOOFROWS-3)) sy = NOOFROWS -3;
X    tx		= zz.z_tx;
X    ty		= zz.z_ty;
X    mx		= zz.z_mx;
X    my		= zz.z_my;
X    max_score	= zz.z_max_score;
X    diamonds	= zz.z_diamonds;
X    nf		= zz.z_nf;
X
X    if (maxmoves == -1)
X	maxmoves = 0;	/* to get the "unlimited moves" message */
X
X    goto update_game;	/* the dreaded goto	*/
X    }
X
Xif(screen[ny][nx] == 'C')
X    {
X    screen[ny][nx] = ':';
X    *score+=4;
X    if (*bell)
X	beep();
X    if(maxmoves != -1)
X	maxmoves+=250;
X    }
X
Xcannot_move:		/* try again with nx=x and ny=y in case we're */
X			/* debugging and the monster's got'im */
Xswitch(screen[ny][nx])
X    {
X    case '@':
X	break;
X    case '*':
X	*score+=9;
X	if (*bell)
X	    beep();
X	max_score -= 10;
X	nf++;
X    case ':':
X	*score+=1;
X	update_score(*score,nf,diamonds);
X    case ' ':
X	if(screen[y][x] != 'S')
X	    draw( x, y, sx, sy, ' ' );
X	else
X	    reset_under(x,y);
X	draw( nx, ny, sx, sy, '@' );
X	deadyet += check(&mx,&my,x,y,nx-x,ny-y,sx,sy,howdead);
X    	move(16,0);
X    	refresh();
X	y = ny;
X	x = nx;
X	break;
X    case 'O':
X	if(screen[y][nx*2-x] == 'M')
X	    {
X	    screen[y][nx*2-x] = ' ';
X	    mx = my = -1;
X	    if (*bell)
X		beep();
X	    *score+=100;
X	    update_score(*score,nf,diamonds);
X#ifdef	EGA
X	    if(EGAaddr) {
X		if(debug_disp)
X		    egapaint( 480,289, b48x48[SPACE] );
X		else
X		    egapaint( 566,130, b48x48[SPACE] );
X		}
X	    else
X#endif
X		{
X		draw_symbol(48,10,' ');
X		move(16,0);
X		refresh();
X		}
X	    }
X	if(screen[y][nx*2-x] == ' ')
X	    {
X	    if(screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	    else
X		reset_under(x,y);
X	    draw( nx, ny, sx, sy, '@' );
X	    draw( nx*2-x, y, sx, sy, 'O' );
X	    deadyet += fall(&mx,&my,nx*2-x,y+1,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x*2-nx,y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y-1,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y+1,sx,sy,howdead);
X	    move(16,0);
X	    refresh();
X	    y = ny;
X	    x = nx;
X	    break;
X	    }
X	else
X	    {
X	    nx = x;
X	    ny = y;
X	    goto cannot_move;
X	    }
X    case '^':
X	if(screen[y][nx*2-x] == ' ')
X	    {
X	    if(screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	    else
X		reset_under(x,y);
X	    draw( nx, ny, sx, sy, '@' );
X	    draw( nx*2-x, y, sx, sy, '^' );
X	    deadyet += fall(&mx,&my,nx*2-x,y-1,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x*2-nx,y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y+1,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x,y-1,sx,sy,howdead);
X	    move(16,0);
X	    refresh();
X	    y = ny;
X	    x = nx;
X	    break;
X	    }
X	else
X	    {
X	    nx = x;
X	    ny = y;
X	    goto cannot_move;
X	    }
X    case '<':
X    case '>':
X	if(screen[ny*2-y][x] == 'M')
X	    {
X	    screen[ny*2-y][x] = ' ';
X	    mx = my = -1;
X	    if (*bell)
X		beep();
X	    *score+=100;
X	    update_score(*score,nf,diamonds);
X#ifdef	EGA
X	    if(EGAaddr) {
X		if(debug_disp)
X		    egapaint( 480,289, b48x48[SPACE] );
X		else
X		    egapaint( 566,130, b48x48[SPACE] );
X		}
X	    else
X#endif
X		{
X		draw_symbol(48,10,' ');
X		move(16,0);
X		refresh();
X		}
X	    }
X	if(screen[ny*2-y][x] == ' ')
X	    {
X	    draw( x, ny*2-y, sx, sy, screen[ny][nx] );
X	    if(screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	    else
X		reset_under(x,y);
X	    draw( nx, ny, sx, sy, '@' );
X	    deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x-1,(ny>y)?y:(y-1),sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x+1,(ny>y)?y:(y-1),sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x-1,ny*2-y,sx,sy,howdead);
X	    deadyet += fall(&mx,&my,x+1,ny*2-y,sx,sy,howdead);
X	    move(16,0);
X	    refresh();
X	    y = ny;
X	    x = nx;
X	    break;
X	    }
X	else
X	    {
X	    nx = x;
X	    ny = y;
X	    goto cannot_move;
X	    }
X    case '!':
X	strcpy(howdead,"an exploding landmine");
X	deadyet = 1;
X	redraw.x = nx;
X	redraw.y = ny;
X	redraw.c = '!';
X	if(screen[y][x] != 'M' && screen[y][x] != 'S')
X	    draw( x, y, sx, sy, ' ' );
X	draw( nx, ny, sx, sy, '@' );
X	move(16,0);
X	refresh();
X	break;
X    case 'X':
X	if(nf == diamonds)
X	    {
X	    *score+=250;
X	    if (*bell)
X		beep();
X	    showpass(*num);
X	    return NULL;
X	    }
X	break;
X    case 'T':
X	if(tx > -1)
X	    {
X	    draw( nx, ny, sx, sy, ' ' );
X	    if(screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	    else
X		reset_under(x,y);
X	    lx = x;
X	    ly = y;
X	    y = ty;
X	    x = tx;
X	    sx = x;
X	    sy = y;
X	    draw( x, y, sx, sy, '@' );
X	    *score += 20;
X	    update_score(*score,nf,diamonds);
X	    if(!debug_disp)
X		display(sx,sy);
X	    else
X#ifdef	EGA
X		if(!EGAaddr)
X#endif
X		    map();
X	    deadyet = fall(&mx,&my,nx,ny,sx,sy,howdead);
X	    if(deadyet == 0)
X		deadyet = fall(&mx,&my,lx,ly,sx,sy,howdead);
X	    if(deadyet == 0)
X		deadyet = fall(&mx,&my,lx+1,ly-1,sx,sy,howdead);
X	    if(deadyet == 0)
X		deadyet = fall(&mx,&my,lx+1,ly+1,sx,sy,howdead);
X	    if(deadyet == 0)
X		deadyet = fall(&mx,&my,lx-1,ly+1,sx,sy,howdead);
X	    if(deadyet == 0)
X		deadyet = fall(&mx,&my,lx-1,ly-1,sx,sy,howdead);
X	    move(16,0);
X	    refresh();
X	    }
X	else
X	    {
X	    redraw.x = nx;
X	    redraw.y = ny;
X	    redraw.c = ' ';
X	    strcpy(howdead,"teleport out of order");
X	    deadyet = 1;
X	    }
X	break;
X    case 'M':
X	strcpy(howdead,"a hungry monster");
X	deadyet = 1;
X	if(nx != x || ny != y)
X	    if(screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	move(16,0);
X	refresh();
X	break;
X    case 'S':
X	strcpy(howdead,"walking into a monster");
X	deadyet = 1;
X	if(nx != x || ny != y)
X	    if(screen[y][x] != 'M' && screen[y][x] != 'S')
X		draw( x, y, sx, sy, ' ' );
X	move(16,0);
X	refresh();
X	break;
X    default:
X	nx = x;
X	ny = y;
X	goto cannot_move;
X    }
X
Xif((y == ny) && (x == nx) && (maxmoves>0))
X#ifdef	EGA
X    if(EGAaddr) {
X	if(debug_disp)
X	    egaprintf( 4+28*8,288, "Remaining moves %6d", --maxmoves );
X	else
X	    egaprintf( 540,84, "Moves %6d", --maxmoves );
X	}
X    else
X#endif
X	mvprintw(15,48,"Moves remaining = %d ",--maxmoves);
X
Xif(maxmoves == 0)
X    return "running out of time";
Xif(!debug_disp)
X    {
X    if ((x<(sx-3))&& (deadyet ==0))         /* screen scrolling if necessary */
X	{
X	sx-=6;
X	if(sx < 4)
X	    sx = 4;
X	display(sx,sy);
X	}
X    if ((y<(sy-2))&& (deadyet == 0))
X	{
X	sy-=5;
X	if(sy < 2)
X	    sy = 2;
X	display(sx,sy);
X	}
X    if ((x>(sx+3)) && (deadyet == 0))
X	{
X	sx+=6;
X	if(sx>(ROWLEN -5))
X	    sx = ROWLEN -5;
X	display(sx,sy);
X	}
X    if ((y>(sy+2))&& (deadyet ==0))
X	{
X	sy+=5;
X	if(sy > (NOOFROWS-3))
X	    sy = NOOFROWS -3;
X	display(sx,sy);
X	}
X    }
X
X	/* MONSTER SECTION  */
X
X/* big monster first */
Xif(mx == -2)                              /* has the monster been killed ? */
X    {
X    *score+=100;
X    mx = my = -1;
X    update_score(*score,nf,diamonds);
X#ifdef	EGA
X    if(EGAaddr) {
X	if(debug_disp)
X	    egapaint( 480,289, b48x48[SPACE] );
X	else
X	    egapaint( 566,130, b48x48[SPACE] );
X	}
X    else
X#endif
X	{
X	draw_symbol(48,10,' ');
X	move(16,0);
X	refresh();
X	}
X    }                                     /* if monster still alive */
Xelse if(mx != -1 && !deadyet)             /* then move that monster ! */
X    {
X    if(mx>x)
X	xdirection = -1;
X    else
X	xdirection = 1;
X    draw( mx, my, sx, sy, ' ' );
X    if((hd = (mx-x))<0)
X	hd = -hd;
X    if((vd = (my-y))<0)
X	vd = -vd;
X    if((hd>vd)&&((screen[my][mx+xdirection] == ' ')||(screen[my][mx+xdirection] == '@')))
X	mx+=xdirection;
X    else
X	{
X	if(my>y)
X	    ydirection = -1;
X	else
X    	    ydirection = 1;
X	if((screen[my+ydirection][mx] == ' ')||(screen[my+ydirection][mx] == '@'))
X	    my+=ydirection;
X	else
X	    if((screen[my][mx+xdirection] == ' ')||(screen[my][mx+xdirection] == '@'))
X	mx+=xdirection;
X	}
X    if(screen[my][mx] == '@')          /* ha! got'im! */
X	{
X	strcpy(howdead, "a hungry monster");
X	deadyet = 1;
X	}
X    draw( mx, my, sx, sy, 'M' );
X    move(16,0);
X    refresh();
X    }
X
Xcurrent = &start_of_list;                         /* baby monsters now */
Xwhile((current != tail_of_list)&&(!deadyet))
X    /* deal with those little monsters */
X    {
X    monster = current->next;
X    if(new_direction(monster->x,monster->y,monster->mx,monster->my,&new_disp))
X	{
X	/* move from monster->x,monster->y */
X	if(monster_at_xy(monster->x,monster->y,monster) == NULL)
X	    /* restore screen */
X	    {
X	    draw( monster->x, monster->y, sx, sy, monster->under );
X	    if(monster->under == ' ' || monster->under == '@')
X		deadyet+=check(&mx,&my,monster->x,monster->y,new_disp.d[0],new_disp.d[1],sx,sy,howdead);
X	    }
X	monster->mx = new_disp.d[0];
X	monster->my = new_disp.d[1];
X	monster->x += monster->mx;
X	monster->y += monster->my;
X	/* move to monster->x,monster->y */
X	if(mp = monster_at_xy(monster->x,monster->y,monster))
X	    /* there is another monster already here */
X	    monster->under = mp->under;
X	else
X	    {
X	    monster->under = screen[monster->y][monster->x];
X	    draw( monster->x, monster->y, sx, sy, 'S' );
X	    }
X	}
X    if(monster->under == '@')                     /* monster hit you? */
X	{
X	move(16,0);
X	refresh();
X	strcpy(howdead, "the little monsters");
X	deadyet = 1;
X	}
X    if(monster->under == '+')                    /* monster hit cage? */
X	{
X	*score +=20;
X	if (*bell)
X	    beep();
X	max_score -= 20;
X	update_score(*score,nf,diamonds);
X	/* remove from chain, and insert at the end (at last_of_list) */
X	if(monster == tail_of_list)
X	    tail_of_list = tail_of_list->prev;
X	else
X	    {
X  	    current->next = monster-> next;
X	    current->next->prev = current;
X	    monster->next = NULL;
X	    monster->prev = last_of_list;
X	    last_of_list->next = monster;
X	    last_of_list = monster;
X	    }
X	draw( monster->x, monster->y, sx, sy, '*' );
X	}
X    else
X	current = monster;
X    move(16,0);
X    refresh();
X    }
X
Xif((edit_mode)&&(deadyet)) {         /* stop death if testing */
X#ifdef	EGA
X    if(EGAaddr) {
X	char buffer[80], *next;
X	int line;
X
X	if(debug_disp)
X	    egaprintf(4,341,"You were killed by %s; press 'c' to continue",howdead);
X	else {
X	    sprintf(buffer,"Killed by %s",howdead);
X
X	    line = 200 - 10;
X	    do	{
X		next = split( buffer, 12 );
X		egaputs(540,line+=10,buffer);
X		} while( next && strcpy(buffer,next) );
X
X	    egaputs(540,332,"Press 'c' to");
X	    egaputs(540,341,"  continue");
X	    }
X	}
X    else
X#endif
X	{
X	if(!debug_disp)
X	    move(18,0);
X	else
X	    move(20,0);
X	printw("You were killed by %s\n",howdead);
X	addstr("Press 'c' to continue ");
X	refresh();
X	}
X    if ( !(deadyet = getch() != 'c') ) {
X	if(redraw.c) {
X	    draw( redraw.x, redraw.y, sx, sy, redraw.c );
X	    redraw.c = 0;
X	}
X	if(screen[y][x] != 'M' && screen[y][x] != 'S')
X	    draw( x, y, sx, sy, '@' );
X    }
X#ifdef	EGA
X    if(EGAaddr) {
X	if(debug_disp)
X	    egaclear(4,341, 639,349);
X	else
X	    egaclear(540,200, 639,349);
X	}
X    else
X#endif
X	{
X	if(!debug_disp)
X	    move(18,0);
X	 else
X	    move(20,0);
X	clrtobot();
X	move(16,0);
X	refresh();
X	}
X    }
X
X}
Xreturn(howdead);
X}
X
Xdraw( x, y, sx, sy, c )
X{
Xscreen[y][x] = c;
Xif(!debug_disp)
X    {
X    if( y < sy+4 && y > sy-4 && x < sx+6 && x > sx-6 )
X	draw_symbol( (x-sx+5)*3, (y-sy+3)*2, c );
X    }
Xelse
X    {
X#ifdef	EGA
X    if(EGAaddr) {
X	bitmap *map = b16x16[ symbol(c) ];
X	egapaint( x * map->width, y * map->height, map );
X	}
X    else
X#endif
X	{
X	move(y+1,x+1);
X	addch(c);
X	}
X    }
X}
X
X
X#ifdef	EGA
X/*
X * Split a string at the first white space such that the portion is
X * not longer than max
X */
Xchar *split( string, max )
Xchar *string;
X{
Xchar *s = string, *t = NULL, c;
X
Xwhile( c = *string++ ) {
X    if(c == ' ' || c == '\t') {
X	if(string - s - 1 <= max)
X	    t = string - 1;
X	else {
X	    if(!t)
X		t = string - 1;
X
X	    *t++ = 0;
X
X	    return( t );
X	    }
X	}
X    }
X
Xif(!t)
X    return( NULL );
X
X*t++ = 0;
X
Xreturn( t );
X}
X#endif
END_OF_FILE
if test 20960 -ne `wc -c <'game.c'`; then
    echo shar: \"'game.c'\" unpacked with wrong size!
fi
# end of 'game.c'
fi
if test -f 'read.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'read.c'\"
else
echo shar: Extracting \"'read.c'\" \(2132 characters\)
sed "s/^X//" >'read.c' <<'END_OF_FILE'
X#include "wand_head.h"
X
Xextern int edit_mode;
Xextern char *edit_screen;
Xextern char *screenpath;
Xextern char (*screen)[ROWLEN+1+1];
X#ifdef	EGA
Xextern char *EGAaddr;
X#endif
X
Xint rscreen(num,maxmoves)
Xint *maxmoves, num;
X{
Xint  y;
XFILE *fp;
Xchar name[50];
Xchar (*row_ptr)[ROWLEN+1+1] = screen;
X
Xif(!edit_mode)
X    sprintf(name,"%s/screen.%d",screenpath,num);
Xelse
X    {
X    if(!edit_screen)
X	strcpy(name,"./screen");
X    else
X	strcpy(name,edit_screen);
X    }
Xfp = fopen(name,"r");
Xif(fp == NULL)
X    {
X    if(edit_mode)
X	printf("\nCannot find file %s.\n\n",name);
X    else
X	printf("\nFile for screen %d unavailable.\n\n",num) ;
X    return 1;
X    }
Xelse
X    {
X    for(y = 0;y<NOOFROWS;y++)
X	{
X	fgets(*row_ptr++,ROWLEN + 1,fp);
X	fgetc(fp);                         /* remove newline char*/
X	}
X    if(fscanf(fp,"%*s\n%d",maxmoves) != 1)
X	*maxmoves=0;
X    fclose(fp);
X    return 0;
X    }
X}
X
Xint wscreen(maxmoves)
Xint maxmoves;
X{
Xint  y,x;
XFILE *fp;
Xstatic char name[50];
Xchar buffer[80];
X
Xif(!edit_screen)
X    strcpy(name,"./screen");
Xelse
X    strcpy(name,edit_screen);
Xfp = fopen(name,"w");
Xif(fp == NULL)
X    {
X    sprintf(edit_screen=name,"/tmp/screen.%d",getpid());
X    fp = fopen(name,"w");
X    if(fp == NULL) {
X#ifdef	EGA
X	if(EGAaddr)
X	    sprintf(buffer,"Screen file set to \"%s\"; cannot be written.",edit_screen);
X	else
X#endif
X	    mvaddstr(21,0,"Screen file cannot be written");
X	}
X    else {
X#ifdef	EGA
X	if(EGAaddr)
X	    sprintf(buffer,"Screen file set to \"%s\"; written.",edit_screen);
X	else
X#endif
X	    mvprintw(20,0,"Screen file set to %s",name);
X	}
X    refresh();
X    }
X#ifdef	EGA
Xelse
X    sprintf(buffer,"Screen file \"%s\" written.",name);
X#endif
Xif(fp != NULL)
X    {
X    for(y = 0;y<NOOFROWS;y++)
X	{
X	for(x = 0;x<ROWLEN;x++)
X	    fputc(screen[y][x],fp);
X	fputc('\n',fp);
X	}
X    for(x = 0; x<ROWLEN;x++)
X	fputc('#',fp);
X    fputc('\n',fp);
X    if(maxmoves != 0)
X	fprintf(fp,"%d\n",maxmoves);
X    fclose(fp);
X#ifdef	EGA
X    if(EGAaddr) {
X	egaputs(4,341,buffer);
X	egaputs(4+79*8-11*8,341,"Hit any key");
X	(void) Getch();
X	}
X    else
X#endif
X	mvprintw(21,0,"Screen %s written",name);
X    return 0;
X    }
Xelse
X    return 1;
X}
END_OF_FILE
if test 2132 -ne `wc -c <'read.c'`; then
    echo shar: \"'read.c'\" unpacked with wrong size!
fi
# end of 'read.c'
fi
echo shar: End of archive 2 \(of 5\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 5 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0