/* Re-coding of advent in C: data initialization */
static char sccsid
[] = " init.c 4.1 82/05/11 ";
int setbit
[16] = {1,2,4,010,020,040,0100,0200,0400,01000,02000,04000,
010000,020000,040000,0100000};
init(command
) /* everything for 1st time run */
char *command
; /* command we were called with */
rdata(); /* read data from orig. file */
setup
=1; /* indicate that data is in */
if (confirm("got the data. save as \"advent\"? "))
{ if (save(command
,"advent")<0) /* save core image */
{ printf("Save failed\n");
printf("Save succeeded. Adding messages.\n");
if (fork()==0) /* child process */
dup(adfd
); /* output goes to advent file */
execl("/bin/cat","cat",TMPFILE
,0);
printf("unable to find /bin/cat\n");
printf("Advent is ready.\n");
linkdata() /* secondary data manipulation */
for (i
=1; i
<=LOCSIZ
; i
++)
if (ltext
[i
].seekadr
!=0 && travel
[i
] != 0)
if ((travel
[i
]->tverb
)==1) cond
[i
]=2;
if (plac
[j
]!=0 && fixd
[j
]<=0) drop(j
,plac
[j
]);
for (i
=50; i
<=maxtrs
; i
++)
{ if (ptext
[i
].seekadr
!=0) prop
[i
] = -1;
pillow
=vocab("pillow",1);
oyster
=vocab("oyster",1);
/* random flags & ctrs */
if (rtext
[2*i
+81].seekadr
!=0) maxdie
=i
+1;
numdie
=holdng
=dkill
=foobar
=bonus
=0;
closng
=panic
=closed
=scorng
=FALSE
;
trapdel() /* come here if he hits a del */
{ delhit
++; /* main checks, treats as QUIT */
signal(2,trapdel
); /* catch subsequent DELs */
srand(tvec
[1]|1); /* random odd seed */
/* srand(371); */ /* non-random seed */
if (hinted
[3]) limit
=1000; /* better batteries if instrucs */