#define a044 "12.68, 24 Feb 2016"
#include "adv1.h"
#include "adv0.h"
#ifdef d000
#ifndef CONSOLE
#define CONSOLE
#endif
#ifndef NO_READLINE
#define NO_READLINE
#endif
#ifndef NO_SLOW
#define NO_SLOW
#endif
#ifndef SWAP
#define SWAP 32
#endif
#endif
#ifdef c001
#include "z043.h"
#endif 
#if defined(m046)
#ifndef l000
#define l000
#endif
#endif 
#ifdef l000
#ifndef NO_READLINE
#define NO_READLINE
#endif
#ifndef CONSOLE
#define CONSOLE
#endif
#endif 
#ifdef r057
#undef r057
#endif 
#ifdef m047
#undef m047
#if defined(MEMORY)
#undef MEMORY
#endif
#if defined(SWAP)
#undef SWAP
#endif
#if defined(FILE)
#undef FILE
#endif
#if defined(q010)
#undef q010
#endif
#define q010 0
#endif 
#ifdef MEMORY
#undef MEMORY
#if defined(SWAP)
#undef SWAP
#endif
#if defined(FILE)
#undef FILE
#endif
#if defined(q010)
#undef q010
#endif
#define q010 1
#endif 
#if defined(SWAP)
#if !(SWAP >= 16 && SWAP <= 128)
#undef SWAP
#endif
#if defined(FILE)
#undef FILE
#endif
#if defined(q010)
#undef q010
#endif
#define q010 2
#endif 
#ifdef FILE
#undef FILE
#if defined(q010)
#undef q010
#endif
#define q010 3
#endif 
#ifdef q010
#if q010 == 0
#define m047
#endif
#if q010 == 1
#define MEMORY
#endif
#if q010 == 2 && !defined(SWAP)
#define SWAP 32
#endif
#if q010 == 3
#define w045
#endif
#endif 
#ifdef SWAP
#if SWAP < 16
#undef SWAP
#define SWAP 16
#endif 
#if SWAP > 128
#undef SWAP
#define SWAP 128
#endif 
#endif 
#ifndef m047
#define r057
#endif
#if t000
#define s044 "HOMEPATH"
#define q049 "\r\n"
#define c042 '/'
#define q050 '\\'
#else 
#define s044 "HOME"
#define q049 "\n"
#define c042 '-'
#define q050 '/'
#endif 
#include <stdio.h>
#include <time.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#define b050 \
"HTTP/1.0 200 OK\n" \
"Host: localhost\n" \
"Server: A-code/1.1\n" \
"Cache-Control: no-store\n" \
"Content-Type: text/html\n" \
"Content-Length: "
int r058 = 0; 
#include <sys/types.h>
#include <sys/stat.h>
#define k048 "rb"
#define m048 "wb"
#define f043 "ab+"
#ifdef __STDC__
void i052 (char *); void e052 (char *, int); extern int n041 (int, char
*); 
#else
void i052(); void e052(); extern int n041(); 
#endif
#ifdef CONSOLE
#ifdef q051
#undef q051
#endif
#else
#define q051
#endif
#ifndef NO_READLINE
#include "readline/readline.h"
#include "readline/history.h"
char *e053; char *s045; 
#endif 
FILE *a045; FILE *v042; FILE *u040 = NULL; char m049 [160]; FILE *i053 =
NULL; char *k049 = NULL; char *t046 = NULL; 
#ifndef r057
#include "adv6.h"
#endif 
void k050 (int); int q004; jmp_buf m005; 
#ifdef r057
char *c043 = NULL; 
#endif 
char w046; 
#define m050 (k009 * sizeof (int))
#define b051 m050
#define i054 ((z009 + 1) * sizeof (int))
#define d041 (b051 + i054)
#define q052 (z008 * (z009 - q005 + 1) * sizeof (short))
#define e054 (d041 + q052)
#define x046 (f009 * (g006 - a005 + 1) * sizeof (short))
#define h043 (e054 + x046)
#define i055 (s003 * (q006 - b006 + 1) * sizeof (short))
#define m051 (s003 * (n005 - b006 + 1) * sizeof (short))
#define l044 (h043 + i055)
char b052 [l044]; int *i003 = (int *)b052; int *f006 = (int *)(b052 + b051);
short *a004 = (short *)(b052 + d041); short *y003 = (short *)(b052 + e054);
short *w002 = (short *)(b052 + h043); 
#ifdef q008
char a046 [sizeof (b052)]; int y054 [i054]; unsigned char *g048 = NULL;
unsigned char *k051 = NULL; unsigned char *e055; int w047 = 0; 
#ifdef b053
int i056 = -2; 
#else
int i056 = 0; 
#endif 
#endif
char *r059; char *d042; char *f044 = NULL; int k052; char q053 [161] = "\n";
char o050 [161] = "\n"; char x047 [161]; char k053 [161]; int z044, z045;
int g049; int l045 [5]; int *d043 = &l045[0]; int *r060 = &l045 [1]; int
*s046 = &l045 [2]; int *v043 = &l045 [3]; int *x048 = &l045 [4]; char o051[160];
#define d044 20
char f045 [5 * d044]; char *e056 = f045; char *o052 = f045 + d044; char
g050 [d044]; char *g051 = f045 + 2 * d044; char *o053 = f045 + 3 * d044;
char *q054 = f045 + 4 * d044; char r061 [d044]; 
#if j000 >= 11
#define v044 -1
char l046 [d044]; char u041 [d044]; char f046 [d044]; 
#if defined(i004) && defined(t009)
int c044; int x049 [100]; 
#endif 
#endif 
int k054; int m052 = 0; int m053 = 1; 
#ifdef k001
int z046 = 0; 
#endif
#if j000 == 10
int m054 = 1; 
#else
int m054 = 0; 
#endif
int z006 = 1; int a047; char a048[2]; 
#if defined(PAUSE) || t000
int n042 = 1; 
#else
int n042 = 0; 
#endif
#ifdef q051
#include <fcntl.h>
char *i057; int o054 = 0; 
#endif
int t047 = 0; char a049 [160]; char i058 [80]; char *o055; 
#include "adv3.h"
#include "adv4.h"
#include "adv2.h"
#include "adv5.h"
#ifdef c006
int x050; 
#endif 
#ifdef MEMORY
unsigned char i001 [t012]; 
#endif 
#ifdef SWAP
#define x051 1024
unsigned char i001 [SWAP * x051]; int u042 [SWAP]; int f047 [SWAP]; int
d045 [SWAP]; 
#endif 
#if t000
char k055 [160]; 
#endif 
char *n043 [100]; char l047 [100]; short b054; int d046 = 24; int f048 =
80; int w048 = 1; int s047; int z047; int d047; int u043; 
#ifdef z048
int n044; int j048; 
#endif 
char *n045; int q055 = 4096; char *w049; short *n046; int q056 = 1; char
*j049; int x052 = 0; int g052; int d048 = 0; 
#ifndef NO_SLOW
#if t000
#ifdef __STDC__
extern void x002 (int); 
#else 
extern void x002(); 
#endif
#define usleep(X) x002(X)
#else 
#if defined(t002)
void usleep(int); 
#endif
#endif 
#endif 
int z049 = 0; int o056; char u044 [80]; int y055; int o057; int n047 = 0;
#ifdef f000
int d049 = 0; 
#endif 
char *u045; 
#define y056(X) { char *u046 = X; while (*u046) o003(*u046++); }
#define g053(X) fputs(X, stdout); if (u040) fputs(X,u040);
#define z050(X,Y) printf(X,Y); if (u040) fprintf(u040,X,Y);
#define x053(X) if (u040) fprintf(u040,"ERROR: %d",X)
#define n048(X,Y) for (x054=(char *)X,o058=1; \
(unsigned int)o058<=(unsigned int)Y;o058++,x054++) \
{o059+=(*x054+o058)*(((int)(*x054)+o058)<<4)+Y; \
o059&=07777777777L;} 
#define a050 "Restoring game in progress...\n\n"
#ifndef l000
#define l048 0
#define n049 1
#define n050 2
#define v045 3
#define c045 4
#define f049 5
#define t048 6
#define s048 7
#define y057 8
#define c046 9
#define o060 10
#define JUSTIFY 11
#define MARGIN 12
#define e057 13
#define h044 14
#define n051 15
#define w050 16
#define b055 17
#define o061 18
char *k056[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; 
#define r062 "&nbsp;&nbsp;<input type=\"submit\" name=\"Submit\", value=\"Submit\">"
int u047 = 100; 
#endif 
#if !defined(NOVARARGS) && defined(__STDC__)
int m002 (int m003, ...) { va_list g054; int r063; va_start (g054, m003);
r063 = m003; while (r063 >= 0) { if (e004 (r063)) { va_end (g054); return
(1); } r063 = va_arg (g054, int); } va_end (g054); return (0); } int r006
(int m003, ...) { va_list g054; int r063; va_start (g054, m003); r063 =
m003; while (r063 >= 0) { if (!e004 (r063)) { va_end (g054); return (0);
} r063 = va_arg (g054, int); } va_end (g054); return (1); } 
#else 
#ifdef __STDC__
int m002 (int n052,int r001,int o000,int y000,int z001,int o062,int s049,int
n053, int c047,int o063,int e058,int s050,int o064,int q057,int f050,int
f051) 
#else
int m002 (n052,r001,o000,y000,z001,o062,s049,n053,c047,o063,e058,s050,o064,q057,f050,f051)
int n052,r001,o000,y000,z001,o062,s049,n053,c047,o063,e058,s050,o064,q057,f050,f051;
#endif
{ if (n052 == -1) return (0); if (e004 (n052)) return (1); if (r001 == -1)
return (0); if (e004 (r001)) return (1); if (o000 == -1) return (0); if
(e004 (o000)) return (1); if (y000 == -1) return (0); if (e004 (y000)) return
(1); if (z001 == -1) return (0); if (e004 (z001)) return (1); if (o062 ==
-1) return (0); if (e004 (o062)) return (1); if (s049 == -1) return (0);
if (e004 (s049)) return (1); if (n053 == -1) return (0); if (e004 (n053))
return (1); if (c047 == -1) return (0); if (e004 (c047)) return (1); if
(o063 == -1) return (0); if (e004 (o063)) return (1); if (e058 == -1) return
(0); if (e004 (e058)) return (1); if (s050 == -1) return (0); if (e004 (s050))
return (1); if (o064 == -1) return (0); if (e004 (o064)) return (1); if
(q057 == -1) return (0); if (e004 (q057)) return (1); if (f050 == -1) return
(0); if (e004 (f050)) return (1); if (f051 == -1) return (0); if (e004 (f051))
return (1); return (0); } 
#ifdef __STDC__
int r006 (int n052,int r001,int o000,int y000,int z001,int o062,int s049,int
n053, int c047,int o063,int e058,int s050,int o064,int q057,int f050,int
f051) 
#else
int r006 (n052,r001,o000,y000,z001,o062,s049,n053,c047,o063,e058,s050,o064,q057,f050,f051)
int n052,r001,o000,y000,z001,o062,s049,n053,c047,o063,e058,s050,o064,q057,f050,f051;
#endif
{ if (n052 == -1) return (1); if (!e004 (n052)) return (0); if (r001 ==
-1) return (1); if (!e004 (r001)) return (0); if (o000 == -1) return (1);
if (!e004 (o000)) return (0); if (y000 == -1) return (1); if (!e004 (y000))
return (0); if (z001 == -1) return (1); if (!e004 (z001)) return (0); if
(o062 == -1) return (1); if (!e004 (o062)) return (0); if (s049 == -1) return
(1); if (!e004 (s049)) return (0); if (n053 == -1) return (1); if (!e004
(n053)) return (0); if (c047 == -1) return (1); if (!e004 (c047)) return
(0); if (o063 == -1) return (1); if (!e004 (o063)) return (0); if (e058
== -1) return (1); if (!e004 (e058)) return (0); if (s050 == -1) return
(1); if (!e004 (s050)) return (0); if (o064 == -1) return (1); if (!e004
(o064)) return (0); if (q057 == -1) return (1); if (!e004 (q057)) return
(0); if (f050 == -1) return (1); if (!e004 (f050)) return (0); if (f051
== -1) return (1); if (!e004 (f051)) return (0); return (1); } 
#endif 
#ifdef __STDC__
int e001 (int o004) 
#else
int e001 (o004) int o004; 
#endif
{ k054 = (((k054 << 10) + k054) / 13) & 32767; return (k054 % o004); } 
#ifdef __STDC__
int i002 (int o004) 
#else
int i002 (o004) int o004; 
#endif
{ int m055; m055 = (((k054 << 10) + (int) time (NULL)) / 13) & 32767; return
(m055 % o004); } 
#if j000 >= 11
#define j050 -1
#define m056 1
#define f052 1
#define c048 3
#define k057 4
#define k058 4096
#define r064 *((unsigned short *)(s051 + 2))
short *u048 (short *s051) { if (s051 == NULL) { if ((s051 = (short *)malloc(k058
* sizeof(short))) == NULL) return (NULL); *s051 = 3; *(s051 + 1) = 0; r064
= k058; } else { if ((s051 = (short *)realloc (s051, (*(s051 + 2) + k058)
* sizeof(short))) == NULL) return (NULL); r064 += k058; } return (s051);
} 
#ifdef DEBUG
void h045 (short *s051, char *i001) { short *n054; printf ("Show: %s, free: %hd, root: %hd\n",
i001, *s051, *(s051 + 1)); n054 = s051 + 3; while (n054 < s051 + *s051)
{ fprintf (stderr, "Offset %d: Up %hd, L %hd, R %hd, B %hd, T: %s\n", n054
- s051, *(n054 + m056), *(n054 + m056 + j050), *(n054 + m056 + f052), *(n054
+ c048), (char *)(n054 + k057)); n054 += k057 + 1 + strlen ((char *) (n054
+ k057)) / 2; } } 
#endif 
void y058 (char *y059, int a051, short *o065) { char *x054 = (char *) (o065
+ k057); while (a051--) *x054++ = tolower (*y059++); *x054 = '\0'; } int
s052 (char *l004, char *g055) { int g056, g057; while (*l004) { g057 = tolower
((unsigned char) *l004++); if (!isalpha (g057)) return (*g055 ? -1 : 0);
g056 = (unsigned char) *g055++; if (g057 != g056) return (g057 > g056 ?
1 : -1); } return (0); } void y060 (short *s051, int y061, int u049, int
a052) { int q058 = *(s051 + y061 + m056); int y062 = *(s051 + u049 + m056
- a052); *(s051 + y061 + m056 + a052) = *(s051 + u049 + m056 - a052); *(s051
+ u049 + m056 - a052) = y061; *(s051 + y061 + c048) -= *(s051 + u049 + c048);
*(s051 + u049 + c048) = -(*(s051 + y061 + c048)); if (q058 > 0) *(s051 +
q058 + m056 + (*(s051 + q058 + m056 + j050) == y061 ? j050 : f052)) = u049;
else *(s051 + 1) = u049; *(s051 + u049 + m056) = q058; *(s051 + y061 + m056)
= u049; if (y062) *(s051 + y062 + m056) = y061; } void s053 (short *s051,
int y061, int u049, int a052) { int q058 = *(s051 + y061 + m056); int y062
= *(s051 + u049 + m056 - a052); *(s051 + u049 + m056 - a052) = *(s051 +
y062 + m056 + a052); if (*(s051 + y062 + m056 + a052)) *(s051 + *(s051 +
y062 + m056 + a052) + m056) = u049; *(s051 + y061 + m056 + a052) = *(s051
+ y062 + m056 - a052); if (*(s051 + y062 + m056 - a052)) *(s051 + *(s051
+ y062 + m056 - a052) + m056) = y061; *(s051 + y062 + m056 + a052) = u049;
*(s051 + y062 + m056 - a052) = y061; if (*(s051 + y062 + c048) == *(s051
+ u049 + c048)) *(s051 + u049 + c048) *= -1; else *(s051 + u049 + c048)
= 0; if (*(s051 + y062 + c048) == *(s051 + y061 + c048)) *(s051 + y061 +
c048) *= -1; else *(s051 + y061 + c048) = 0; *(s051 + y062 + c048) = 0;
*(s051 + u049 + m056) = y062; *(s051 + y061 + m056) = y062; *(s051 + y062
+ m056) = q058; if (q058 > 0) *(s051 + q058 + m056 + (*(s051 + q058 + m056
+ j050) == y061 ? j050 : f052)) = y062; else *(s051 + 1) = y062; } short
*e059 (short *s051, char *l004, int a051) { int y061 = 0; int u049 = *(s051
+ 1); int a052; short *o065; int r065 = k057 + 1 + a051 / 2; if (*(s051
+ 1) > 0) { while (u049 > 0) { if ((a052 = s052 (l004, (char *)(s051 + u049
+ k057))) == 0) return (s051); y061 = u049; u049 = *(s051 + u049 + m056
+ a052); } } if (*s051 + r065 > r064 && (r064 > 65535L - r065 || (s051 =
u048 (s051)) == NULL)) return (NULL); o065 = s051 + (u049 = *s051); *(o065
+ m056) = y061; *(o065 + m056 + j050) = *(o065 + m056 + f052) = 0; *(o065
+ c048) = 0; y058 (l004, a051, o065); *s051 += r065; if (y061) { *(s051
+ y061 + m056 + a052) = u049; while (1) { a052 = *(s051 + y061 + m056 +
j050) == u049 ? j050 : f052; if (*(s051 + y061 + c048) == a052) { if (*(s051
+ u049 + c048) == -a052) s053 (s051, y061, u049, a052); else y060 (s051,
y061, u049, a052); break; } if ((*(s051 + y061 + c048) += a052) == 0) break;
u049 = y061; y061 = *(s051 + y061 + m056); if (y061 == 0) break; } } else
*(s051 + 1) = u049; return (s051); } int a053 (short *s051, char *l004)
{ int l049; int a052; if ((l049 = *(s051 + 1)) == 0) return (0); while (l049)
{ if ((a052 = s052 (l004, (char *)(s051 + l049 + k057))) == 0) return (l049);
l049 = *(s051 + l049 + m056 + a052); } return (0); } 
#ifdef __STDC__
void d050 (void) 
#else
void d050 () 
#endif
{ char *j051 = n045; char *z051; while (1) { while (*j051 && ! isalpha (*j051))
j051++; if (*j051 == '\0') break; z051 = j051 + 1; while (*z051 && isalpha
(*z051)) z051++; if (z051 - j051 > 4 && *(z051 - 3) != 'i' && *(z051 - 2)
!= 'n' && *(z051 - 1) != 'g') e059 (n046, j051, z051 - j051); if (*z051
== '\0') break; j051 = z051 + 1; } return; } 
#endif 
#define l050 100
#if defined(PLAIN) && (defined(MEMORY) || defined(m047))
#define l051(X) i001[X]
#else 
#ifdef __STDC__
char l051 (int l052) 
#else
char l051 (l052) int l052; 
#endif
{ 
#ifndef PLAIN
int y063; 
#endif 
#if defined(MEMORY) || defined (m047)
y063 = (l052 >> 4) & 127; if (y063 == 0) y063 = l052 & 127; if (y063 ==
0) y063 = 'X'; y063 = (17 * y063 + 13) & 127; return (y063 ^ i001 [l052]
^ u044 [l052 % y055]); 
#endif 
#ifdef SWAP
int f053; unsigned char *d051; int s054; int o066; void t049 (); s054 =
0; d051 = i001; for (f053 = 0; f053 < SWAP; f053++) { if (l052 >= u042 [f053]
&& l052 < f047 [f053]) goto q059; d051 += x051; } for (f053 = 0; f053 <
SWAP; f053++) { if (f047 [f053] == 0) goto m057; if (d045 [s054] > d045
[f053]) s054 = f053; } f053 = s054; m057: d047++; d051 = i001 + x051 * f053;
o066 = (l052 / x051) * x051 ; if (fseek (a045, o066, 0)) t049 (); u042 [f053]
= o066; f047 [f053] = fread (d051, sizeof (char), x051, a045) + o066; 
#ifdef z048
fprintf (stderr, "Wanted %6d.  Buffer %3d: from %dK.\n", l052, f053, o066
/ x051); 
#endif 
if (u042 [f053] > f047 [f053]) t049 (); q059: d045 [f053] = u043; 
#ifdef PLAIN
return (*(d051 + l052 - u042 [f053])); 
#else 
y063 = (l052 >> 4) & 127; if (y063 == 0) y063 = l052 & 127; if (y063 ==
0) y063 = 'X'; y063 = (17 * y063 + 13) & 127; return (*(d051 + l052 - u042
[f053]) ^ y063 ^ u044 [l052 % y055]); 
#endif 
#endif 
#ifdef w045
void t049 (); static int v046 = -1; char h046; if (v046 != l052) { d047++;
if (fseek (a045, l052, 0)) t049 (); v046 = l052; } h046 = fgetc (a045);
v046++; 
#ifdef PLAIN
return (h046); 
#else 
y063 = (l052 >> 4) & 127; if (y063 == 0) y063 = l052 & 127; if (y063 ==
0) y063 = 'X'; y063 = (17 * y063 + 13) & 127; return (h046 ^ y063 ^ u044
[l052 % y055]); 
#endif 
#endif 
} 
#if defined(SWAP) || defined(w045)
#ifdef __STDC__
void t049 (void) 
#else
void t049 () 
#endif
{ y056 ("\n \nUnable to retrieve required data! Sorry...\n"); k050 (1);
fclose (a045); if (u040) fclose (u040); exit (0); } 
#endif 
#endif 
#ifdef __STDC__
void g004 (int l004, int f001, int v001, int e060) 
#else
void g004 (l004, f001, v001, e060) int l004; int f001; int v001; int e060;
#endif
{ int f053; int e061; static int n055 = 0; if (l004 == 0) { n055 = 0; return;
} if (f001 == 0) f001 = l004; if (v001 >0 && o002 (f001, v001) == 0) return;
if (n055++ > 0) { o003 (','); o003 (' '); } f053 = (e060 == 0) ? l004 :
e060; z047 = o049 [f053]; e061 = l051 (z047); if (e061 == '!') e061 = l051
(++z047); while (e061 != '\0') { o003 (e061); e061 = l051 (++z047); } }
#ifdef __STDC__
int k059 (char *n054) 
#else
int k059 (n054) int c049; char *n054; 
#endif
{ static int n056 = 0; char g058 [160]; if (t047) return (0); if (!n054
|| i053) { n056 = 0; return (0); } while (*n054 && *n054 != '\n') n054++;
if (*n054 == '\n' && ++n056 >= d046 - (a047 ? 1 : 2)) { if (strcmp(n054
+ 1, "? ") == 0) return (0); memset (g058, ' ', 20); strcpy (g058 + w048,
"[More?] "); g053 (g058); fgets (g058, sizeof (g058) - 1, i053 ? i053 :
stdin); if (u040) fprintf (u040, "\nREPLY: %s", g058); n056 = 1; if (*g058
== 'n' || *g058 == 'N' || *g058 == 'q' || *g058 == 'Q') { memset (g058,
' ', w048); strcpy (g058 + w048, "OK.\n"); if (!a047) strcat (g058, "\n");
g053 (g058); 
#ifdef NO_READLINE
strcpy (g058 + w048, "? "); g053 (g058); 
#else
memset (e053, ' ', w048); strcpy (e053 + w048, "? "); 
#endif 
return (1); } } return (0); } char *c050 (int a051) { char *u046; if ((u046
= (char *) malloc (a051)) == NULL) { fprintf (stderr, "Failed to allocate a %d character memory chunk!\n",
a051); exit (1); } return (u046); } char *d052 (char *h047, int x055) {
char *u046; if ((u046 = (char *) realloc (h047, x055)) == NULL) { fprintf
(stderr, "Failed to extend a memory chunk to %d character!\n", x055); exit
(1); } return (u046); } void k060 (char c) { int y064 = d042 - f044; if
(y064 + 2 >= k052) { k052 += 4096; f044 = d052 (f044, k052); d042 = f044
+ y064; } *d042++ = c; *d042 = '\0'; } void x056 (char *string) { int a051
= strlen (string); int y064 = d042 - f044; if (y064 + a051 + 1 >= k052)
{ k052 += 4096; f044 = d052 (f044, k052); d042 = f044 + y064; } strcpy (d042,
string); d042 += a051; } void y065 (char *x054) { 
#ifdef NO_SLOW
fputs (x054, stdout); fflush (stdout); 
#else
if (d048) { while (*x054) { usleep (d048); putchar (*x054++); fflush (stdout);
} } else { fputs (x054, stdout); fflush (stdout); } 
#endif 
} void d053 (char c, char g059) { FILE *z052 = (g059 == 'L' ? u040 : stdout);
if (c == s000) c = ' '; 
#ifndef NO_READLINE
if (g059 == 'L') fputc (c, z052); else { *s045++ = c; *s045 = '\0'; if (c
== '\n') { if (*e053) y065 (e053); s045 = e053; *s045 = '\0'; } } 
#else
if (d048 && g059 != 'L') { usleep (d048); fputc (c, z052); fflush (stdout);
} else fputc (c, z052); 
#endif 
} char *o067 (char *n054, int v047) { if (*n054 == f000) { if (!v047) while
(*n054 && *n054 != n001) n054++; else k060 ('<'); } else if (!v047) k060
(*n054); else if (*n054 == '>' || *n054 == '<') x056 (*n054 == '<' ? "&lt;"
: "&gt;"); else if (*n054 == n001) k060 ('>'); else { if (*n054 == ' ' &&
*(n054 + 1) == ' ' && v047) x056 ("&nbsp;"); k060(*n054); } return (n054);
} char *l053 (char *n054, int v047) { char *o068; while (1) { n054++; while
(*n054 == ' ') n054++; o068 = n054; while (* n054 && *n054 != '\n' && *n054
!= c002) n054++; if (!v047) { int l = (s047 - (n054 - o068)) / 2 - 2; if
(l < 0) l = 0 ; while (l--) x056 (v047 ? "&nbsp;" : " "); } while (o068
< n054) { if (*o068 == s000) x056 (v047 ? "&nbsp;" : " "); else o067 (o068,
v047); o068++; } if (*n054 != '\n') break; x056 (v047 ? "<br>\n" : "\n");
} return (n054); } char *a054 (char *n054, int v047) { int o069 = 4096;
int h048 = 0; int i; int type = *n054++; char *o068 = n054; int o070; char
*k061; while (1) { k061 = o068; while (*o068 == ' ') o068++; if (o068 -
k061 < o069) o069 = o068 - k061; while (*o068 != '\n' && *o068 != c002)
o068++; if (o068 - k061 > h048) h048 = (o068 - k061); o068++; if (!*o068
|| *o068 == c002) break; } o070 = (s047 - h048 + o069) / 2 - 2; if (o070
< 0) o070 = 0; while (1) { if (*n054 == c002) break; for (i = 0; i < o069;
i++) n054++; if (!v047) for (i = 0; i < o070; i++) k060 (' '); while (*n054
!= '\n' && *n054 != c002) { if (*n054 == s000) x056 (v047 ? "&nbsp;" : " ");
else n054 = o067 (n054, v047); n054++; } if (*n054 != c002) x056 (v047 &&
type != n000 ? "<br>\n" : "\n"); else break; n054++; } if (!v047) k060 ('\n');
return (*n054 == c002 ? n054 + 1 : n054); } void z053 (int f004, int v047)
{ char *n054 = n045; char *k061 = j049; int b056 = (k061 > n045 && *(k061
- 1) != '\n'); int type; int f054 = 0; 
#ifdef l000
d042 = f044 + 1; *f044 = ' '; 
#else
d042 = f044 + r058 + (v047 ? 1 : 0); 
#endif 
while (*n054 == '\n') n054++; if (b056 && v047) { k061--; if (*k061 == ' '
|| *k061 == s000) k061--; } while (n054 < k061) { switch (*n054) { case
'\n': if (f054) { f054 = 0; break; } if (!v047) { if (a047 < 2 || *(d042
- 1) != '\n') k060 ('\n'); } if (*(n054 + 1) == '\n') { if (v047) x056 (a047
> 1 ? "<br>\n" : "<br>&nbsp;<br>\n"); else if (a047 < 2) k060 ('\n'); while
(*(n054 + 1) == '\n') n054++; } else if (v047 && *(n054 + 1)) x056 ("<br>\n");
break; case s000: if (v047) x056 ("&nbsp;"); else 
#ifdef l000
k060 (' '); 
#else
k060 (*n054); 
#endif
break; case n000: case x000: case b000: if (v047) { if (*n054 != b000) x056
("<table align=center width=automatic><tr><td>\n"); else x056("<div align=center>\n");
if (*n054 == n000) x056 ("<pre>"); } type = *n054; if (type == b000) n054
= l053 (n054, v047); else n054 = a054 (n054, v047); if (v047) { if (type
== n000) x056 ("</pre>"); if (type != b000) x056 ("</td></tr></table>\n");
else x056 ("</div>\n"); x056 ("</center>\n"); if ((type == b000 || a047
> 1) && *n054) { if (*(n054 + 1) == '\n') n054++; if (a047 > 1 && *(n054
+ 1) == '\n') n054++; } } break; case m000: f054 = 1; break; case c002:
break; default: n054 = o067 (n054, v047); break; } if (*n054 == '\0') break;
n054++; if (*n054 == '\0') break; } if (v047) { char g060; if (b056) { char
c = *n054; x056 (f004 == 0 ? "<span id=\"prompt\">" : "<span class=\"query\">");
k060 (c); x056 ("</span>"); if (!a047) x056 ("<br>&nbsp;<br>"); } else {
if (!a047 && k061 > n045) x056("<br>&nbsp;<br>"); x056 ("<span id=\"prompt\"></span>");
}; if (o057) g060 = 'f'; 
#ifdef y005
else if (b056) { if (i003 [y005] == 10) g060 = 'm'; else if (i003 [y005]
== 15) g060 = 's'; else if (i003 [y005] == 44) g060 = 'r'; else g060 = 'q';
} 
#else
else if (b056) g060 = 'q'; 
#endif 
else if (t047 == 'b' && a047) g060 = 'c'; else g060 = 't'; *(f044 + r058)
= g060; } else if (b056) { char *f055 = j049 - 1; if (*(d042 - 1) == s000
&& !z006) *(d042 - 1) = ' '; else if (f055 >= n045 && *f055 != ' ' && *f055
!= s000) k060 (' '); } else if (!o057) { if (!a047) k060('\n'); x056 ("? ");
} } void j052 (char *n054, char t) { char *o068 = n054; int a051 = 0; int
o058 = 0; int w051; int t050; int n057; int k004; int k062; static int b057
= 0; while (*o068) { if (*o068++ == ' ') o058++; a051++; } if (o058 == 0)
{ while (*n054) d053 (*n054++, t); return; } w051 = s047 - a051; t050 =
1 + w051 / o058; n057 = w051 % o058; if (b057) { k004 = 0; k062 = n057;
} else { k004 = o058 - n057; k062 = o058; } b057 = 1 - b057; o058 = 0; while
(*n054) { if (*n054 != ' ') d053 (*n054, t); else { int i; for (i = 0; i
< t050; i++) d053 (' ', t); if (o058 >= k004 && o058 < k062) d053 (' ',
t); o058++; } n054++; } } void r066 (char t) { char *n054 = f044 + r058;
char *o068 = n054; char *k061; char c; int i; int q060 = t047 ? 80 : s047;
int i059 = t047 ? 0 : w048; while (1) { o068 = n054; k061 = NULL; while
(o068 - n054 <= q060) { if (*o068 == '\0' || *o068 == '\n') { k061 = o068;
break; } if (*o068 == ' ' || *o068 == '-') k061 = o068; o068++; } 
#ifndef NO_READLINE
s045 = e053; *s045 = '\0'; 
#endif 
if (*o068 == '\n' || *o068 == '\0') { for (i = 0; i < i059; i++) d053 (' ',
t); while (n054 < o068) d053 (*n054++, t); if (*o068 == '\0') break; d053
(*n054++, t); if (*(n054 - 1) == '\n' && t != 'L' && k059 (n054)) break;
continue; } if (!k061) k061 = o068; if (*k061) k061++; c = *k061; *k061
= '\0'; o068 = k061; while (*(o068 - 1) == ' ') o068--; if (o068 < k061)
*o068 = '\0'; if (*n054 != '\n') for (i = 0; i < i059; i++) d053 (' ', t);
if (m054) j052 (n054, t); else while (*n054) { d053 (*n054++, t); if (*(n054
- 1) == '\n' && t != 'L' && k059 (n054)) break; } if (c && *(k061 - 1) !=
'\n') d053 ('\n', t); if (!c) break; if (o068 < k061) *o068 = ' '; *k061
= c; n054 = k061; if (t != 'L' && k059 (n054)) break; } } void k050 (int
f004) { 
#ifdef q051
int m003 = 0; 
#endif
if (!f044) { 
#ifdef q051
m003 = 1; 
#endif
f044 = c050 (4096); k052 = 4096; } 
#ifdef q051
if (m003) { if (t047 == 'b') { n042 = 0; r058 = sizeof (b050) + 8; f005
(k056 [l048], atoi (k056 [w050])); } else puts (""); } 
#endif 
if (j049 > n045) { char *f055 = j049 - 1; char q061 = '\0'; while ((*f055
== ' ' || *f055 == s000 || *f055 == '\n') && f055 > n045) { if (!q061) q061
= *f055; f055--; } if (q061) { *(++f055) = q061; j049 = f055 + 1; *j049
= '\0'; } } if (u040 || !t047) z053 (f004, 0); if (u040) { r066 ('L'); 
#ifndef NO_READLINE
if (u040 && t047) fprintf(u040, e053); 
#endif 
} if (!t047) r066 ('C'); else { z053 (f004, z006); 
#ifndef l000
#ifndef NO_READLINE
s045 = e053; *e053 = '\0'; 
#endif 
#ifdef q051
if (t047 == 'b') o005 (f044); else 
#endif 
{ fputs (f044, stdout); fflush (stdout); } 
#endif 
} j049 = n045; *j049 = '\0'; x052 = 0; } 
#define c051 128
#define i060 64
#if defined(m058) || j000 >= 11
#define b058 32
#endif
#ifdef x005
#define o071 16
#else
#define o071 0
#endif
#define v048 8
#define a055 4
#define f056 2
#define q062 1
#ifdef e000
#ifdef __STDC__
void l054 (int k005, int d002, int r000) 
#else
void l054 (k005, d002, r000) int k005; int d002; int r000; 
#endif
{ int v049; int type; if (d002 &= 14) d002 = 8; type = l051 (k005++); v049
= l051 (k005++) << 8; v049 |= (l051 (k005) & 255); if (type == 0) d002 =
c051; else if (type == 1) d002 = c051; else if (type == 3) { d002 = f056
| c051; r000 = 0; } if (v049 == k010 || v049 == n006) { char *x054 = (v049
== k010) ? e056 : o052; while (*x054) o003 (*x054++); } else { if (type
< 2) r000 = 0; u001 (d002, v049, r000); } z047 = k005; } 
#endif 
#ifdef __STDC__
void u001 (int d002, int f001, int r000) 
#else
void u001 (d002, f001, r000) int d002; int f001; int r000; 
#endif
{ int f053; int o070; int q063; int d054; int c052; int g061; int n058;
#if j000 == 1
int b059 = 0; 
#endif 
int h049; 
#if defined(m058) || j000 >= 11
int v050; 
#endif 
int k063; int q064; int h050; int g062; 
#ifdef e000
int i061 = d002; 
#endif 
char v051 [d044]; int r067; int l055; char *n059; char e061; if (j049 ==
NULL) j049 = n045; u043++; n058 = d002 & i060; 
#if defined(m058) || j000 >= 11
v050 = d002 & b058; 
#endif
d054 = d002 & v048; g061 = d002 & a055; c052 = d002 & f056; q063 = d002
& q062; h049 = d002 & c051; if (c052) { int j053 = i003 [f001]; 
#if j000 >= 11
if ((f001 != k010 && f001 != n006 && f001 != u005) || (j053 != m008 && j053
!= x004 && j053 != n007 && j053 != a008 && j053 != r008)) 
#else
#if j000 == 1
if ((f001 != k010 && f001 != n006 && f001 != u005) || j053 != m008) 
#else
if ((f001 != k010 && f001 != n006 && f001 != u005) || (j053 != m008 && j053
!= x004)) 
#endif
#endif 
f001 = j053; else h049 = 1; } g062 = r000; if (g061 && ((r000 != k010 &&
r000 != n006 && r000 != u005) || q063)) r000 = i003 [r000]; if (f001 > g006
|| h049) { if (h049 && (f001 == k010 || f001 == n006)) { if (f001 == k010)
n059 = e056; else if (f001 == n006) n059 = o052; else n059 = g050; while
(*n059 != '\0') o003 (*n059++); return; } z047 = o049 [f001]; } 
#if g006 > a005
else if (f001 >= a005) { 
#if j000 == 1
if (o002 (q007, m009) || (o002 (f001, i009) && o002 (q007, k011) && !o002
(q007, x005))) z047 = b049 [f001]; else 
#else 
#if defined(m009) && defined(x005) && defined(i009)
if (o002 (q007, m009) || (!o002 (q007, x005) && o002 (f001, i009))) z047
= b049 [f001]; else 
#endif 
#endif 
z047 = r056 [f001]; } 
#endif 
#if z009 > q005
else if (f001 >= q005) { 
#if defined(m058) && j000 == 10
if (o002 (q007, m058)) z047 = a043 [f001]; else 
#endif
#if j000 >= 11 || defined(m058)
if (v050) z047 = a043 [f001]; else 
#endif
if (f006 [f001] == a006) { 
#if j000 == 1
b059 = 1; 
#endif 
z047 = b049 [f001]; } else z047 = r056 [f001]; } 
#endif 
if ((e061 = l051 (z047)) == '\0') goto v052; 
#define d055 1
#define l056 2
#define f057 4
#define s055 8
#define m059 16
if (f001 >= z010) { int u050 = 2 * (f001 - z010); q064 = r000; if (g047
[u050] == d055) { q064 = g047 [u050 + 1]; if (q064 <= 1) q064 = 0; else
{ q064 = e001 (q064 - 1); if (q064 >= i003[f001]) q064++; } i003[f001] =
q064; } else if (g047 [u050] == l056) { q064 = i003 [f001]; if (i003 [f001]
< g047 [u050 + 1] - 1) i003[f001]++; } else if (g047 [u050] == f057) { q064
= i003 [f001]; if (i003 [f001] < g047 [u050 + 1] - 1) i003[f001]++; else
i003 [f001] = 0; } else if (g047 [u050] == s055) q064 = i003 [f001]; else
if (g047 [u050] == m059) q064 = i003 [i003 [f001]]; 
#if j000 == 1 
else if (r000 == n006 && i003 [n006] < m008) 
#else
else if (r000 == n006 && i003 [n006] >= 0) 
#endif 
q064 = i003 [i003 [r000]]; } if (!d054) r000 = (f001 <= g006) ? i003 [f001]
: f001; while (e061 != '\0') { 
#ifdef e000
if (e061 == e000) { l054 (z047 + 1, i061, r000); e061 = l051 (++z047); continue;
} 
#endif 
#ifdef k001
if (e061 == v000) { z046 ^= 1; goto n060; } 
#endif 
if (e061 == l001) { k063 = l051 (++z047); l055 = z047 + 2 * k063 -1; h050
= (f001 >= z010) ? q064 : r000; 
#if j000 == 1
if (b059) h050 = (h050 == 1 || k063 == 1) ? 0 : 1; if (h050 <= 0 || (h050
== 1 && f001 >= z010)) 
#else 
#if j000 >= 11
if (h050 >= k063 && f001 >= z010 && g047[2 * (f001 - z010)] == f057) h050
%= k063; 
#endif
if (h050 <= 0) 
#endif 
z047 = l055 + 1; else { 
#if j000 == 1
z047 = z047 - 1 + 2 * ((h050 > k063) ? k063 - 1 : h050 - 1); if (f001 <
z010) z047 += 2; 
#else 
z047 = z047 - 1 + 2 * ((h050 >= k063) ? k063 - 1 : h050); 
#endif 
o070 = l051 (z047 + 1); if (o070 < 0) o070 += 256; z047 = l055 + 256 * l051
(z047) + o070 + 1; } o070 = l051 (l055 + 1); if (o070 < 0) o070 += 256;
l055 = l055 + 256 * l051 (l055) + o070 + 1; e061 = l051 (z047); } else if
(e061 == d001) { e061 = l051 (z047 = l055++); if (e061 == d001) goto n060;
} 
#if j000 >= 11
else if (e061 == k000 || e061 == c003) { if (q056) q056 = 2; if (q063 ||
e061 == c003) 
#else
else if (e061 == k000) { if (q063) 
#endif
{ sprintf (v051, "%d", r000); n059 = v051 - 1; while (*(++n059) != '\0')
o003 (*n059); goto n060; } 
#if j000 >= 11
else if (r000 == k010 || r000 == n006 || r000 == u005) { if (r000 == k010)
n059 = e056; else if (r000 == n006) n059 = o052; else n059 = g050; while
(*n059 != '\0') o003 (*n059++); goto n060; } else if (r000 == v044) { n059
= l046; while (*n059 != '\0') o003 (*n059++); goto n060; } 
#else 
else if (r000 == k010 || r000 == n006) { n059 = (r000 == k010 ? e056 : o052);
while (*n059 != '\0') o003 (*n059++); goto n060; } 
#endif 
else { f053 = (g061 && g062 <= g006) ? g062 : r000; r067 = z047; u043++;
z047 = o049 [f053]; e061 = l051 (z047); if (e061 == '!') e061 = l051 (++z047);
while (e061 != '\0') { o003 (e061); e061 = l051 (++z047); } z047 = r067;
} } else o003 (e061); n060: e061 = l051 (++z047); } v052: if (n058) longjmp
(m005, 1); return; } 
#ifdef __STDC__
void o003 (char q001) 
#else
void o003 (q001) char q001; 
#endif
{ if (!n045) { n045 = c050 (q055); j049 = n045; } if (x052 == q055 - 8)
{ q055 += 1024; n045 = d052 (n045, q055); j049 = n045 + x052; } 
#ifdef q065
#ifdef f000
if (q001 == f000) { d049 = 1; if (t047) { *j049++ = '<'; x052++; } return;
} else if (d049) { if (q001 == n001) { d049 = 0; if (t047) { x052++; *j049++
= '>'; } return; } } if (d049 && !t047) return; 
#endif 
#endif 
if (q001 == '\n') { n047++; if (n047 > 2) return; } 
#ifdef c002
else if (q001 && q001 != c002 && n047) 
#else
else if (q001 && n047) 
#endif 
n047 = 0; 
#if j000 >= 11
if (isalpha (q001)) { if (q056 == 2) q001 = toupper (q001); q056 = 0; }
else if (isdigit (q001)) q056 = 0; else if (strchr (".!?", q001)) q056 =
1; 
#endif 
x052++; *j049 = q001; 
#ifdef k001
if (i003 [k001] || z046) i052 (j049); 
#endif 
j049++; *j049 = '\0'; return; } 
#ifdef q008
#ifdef __STDC__
void a056 (void) 
#else
void a056 (); 
#endif
{ char *n054; char *d042; unsigned int o058; int d056 = 0; if (i003 [k010]
<= m008 || i003 [n006] <= m008 || 
#ifdef y005
i003 [y005] > 1 || t047 == 'y' || 
#endif
i003 [k010] == q008 || i003 [k010] == j004) return; if (k051 > e055) k051
= e055; if (g048 == NULL) { if ((g048 = (unsigned char *)malloc(8192)) ==
NULL) { printf ("GLITCH: Unable to allocate diffs array!\n"); return; }
else { w047 = 8192; memset (g048, '\0', 4); e055 = k051 = g048 + 4; } }
else { for (o058 = 0, d042 = a046, n054 = b052; o058 < sizeof (b052); o058++,
d042++, n054++) { if (*d042 != *n054 && ! ((o058 >= k010*sizeof(int) &&
o058 < (k010 + 1)*sizeof(int)) || (o058 >= n006*sizeof(int) && o058 < (n006
+ 1)*sizeof(int)) || (o058 >= q007*sizeof(int) && o058 < (q007 + 1)*sizeof(int))))
{ if (k051 - g048 + 8 >= w047) { int d057 = k051 - g048; if ((g048 = (unsigned
char *)realloc(g048, w047 + 8192)) == NULL) { printf ("GLITCH: Unable to re-allocate diffs array!\n");
return; } w047 += 8192; k051 = g048 + d057; } if (o058 || t047 < 'x') {
*k051++ = o058 / 256; *k051++ = o058 % 256; *k051++ = *d042; *k051++ = *n054;
d056 = 1; } } } if (d056) { for (o058 = 0; o058 < 4; o058++) *k051++ = '\0';
e055 = k051; } } memcpy (a046, b052, sizeof (b052)); } 
#endif 
#ifdef __STDC__
void x057 (void) 
#else
void x057 () 
#endif
{ if (i053) fclose (i053); if (u040) { int o058; fprintf (u040, "\nINTERACT\n");
for (o058 = 0; o058 < 39; o058++) fprintf (u040, "*-"); fprintf (u040, "*\n");
fclose (u040); u040 = NULL; } 
#if j000 >= 11
if (n046) free (n046); n046 = NULL; 
#endif
} 
#ifdef __STDC__
void w052 (char *g063, int z054) 
#else
void w052 (g063, z054) char *g063; int z054; 
#endif
{ char *x054; 
#ifndef NO_READLINE
if (!*e053) { memset (e053, ' ', 20); strcpy (e053 + w048, "? "); } 
#endif
#ifdef k001
z046 = 0; 
#endif
#ifdef y005
if (x052 > 3 && i003 [y005] == 0 && !z049 && t047 != 'b') 
#else 
if (x052 > 3 && !z049 && !o057) 
#endif 
{ FILE *c053; char w053[64]; d003 (998, &i003 [0]); sprintf (w053, "%s.adl",
i058); if ((c053 = fopen(w053, m048)) != NULL) { char *x054 = n045; int
a051 = strlen (a050); while (*x054 == '\n') x054++; if (strncmp (x054, a050,
a051) == 0) x054 += a051; fwrite(x054, 1, x052 - (x054 - n045), c053); fclose
(c053); } } 
#ifdef NO_READLINE
if (!*n045 && !o057) y056 (a047 ? "? " : "\n? "); 
#endif 
if (t047 != 'b' && t047 != 'y' && *n045) { k050 (0); k059 (NULL); } 
#if j000 >= 11
q056 = 1; 
#endif 
*g063 = '\0'; 
#ifdef y005
#ifdef m007
y001 ('s', y005, m007); 
#endif
if (t047 == 'x' || t047 == 'z') { d003 (998, &i003 [0]); 
#if j000 >= 11
if (n046) free (n046); n046 = NULL; 
#endif 
#ifdef l000
longjmp (m005, 2); 
#else
exit (i003 [y005]); 
#endif 
} if (t047 == 'y') { strncpy (g063, a049, z054 - 1); t047 = 'z'; if (u040)
fprintf (u040,"\nREPLY: %s\n", g063); return; } 
#endif
z049 = 0; if (i053) { char c054 [256]; char k064 [256]; while (1) { 
#ifndef NO_READLINE
if (!t047) { printf (e053); *e053 = '\0'; } 
#endif 
if (fgets (c054, z054, i053) == NULL || strncmp (c054, "INTERACT", 8) ==
0) { fclose (i053); i053 = NULL; break; } x054 = c054 + strlen (c054); while
(*(x054 - 1) == '\n' || *(x054 - 1) == '\r') x054--; *x054 = '\0'; *k064
= '\0'; if (strncmp (c054, "REPLY:", 6) == 0) { strncpy (g063, c054 + 6,
z054); if (!t047) printf ("%s%s%s\n", k064, g063, a047 ? "" : "\n"); else
{ char u051; while (j049 > n045 && (*(j049 - 1) == ' ' || *(j049 - 1) ==
s000)) j049--; if (*(j049 - 1) == '\n') { if (! a047) j049 += sprintf (j049,
"%cbr /%c", f000, n001); u051 = '?'; } else u051 = *(--j049); j049 += sprintf
(j049, "%cspan class=\"query\"%c%c %s%c/span%c", f000, n001, u051, c054
+ 7, f000, n001); j049 += sprintf (j049, "%c/div%c%c%cdiv id=\"chunk\" name=\"chunk\"%c",
f000, n001, a047 ? ' ' : '\n', f000, n001); } break; } else { int a051 =
strlen (c054); if (a051 > 0) { strcpy (k064, c054); if (*(k064 + a051 -
1) != ' ') strcat (k064, " "); } } } } 
#ifdef q051
if (i053 == NULL && t047 == 'b') { k050 (0); (void) u003 (g063, u047); }
#endif 
if (i053 == NULL && t047 != 'b' && (!o057 || n042)) 
#ifdef NO_READLINE
fgets (g063, z054, stdin); 
#else
{ char *o072; if (t047) fgets (g063, z054, stdin); else { y065 (e053); putchar
('\r'); o072 = readline (e053); if (!a047) putchar ('\n'); if (o072) { memcpy
(g063, o072, z054); add_history (o072); free (o072); *(g063 + z054 - 1)
= 0; } else *g063 = 0; } } if (u040 && t047 != 'b') { fputs (e053, u040);
fflush (u040); } 
#endif 
#ifdef y005
if (t047 == 'x') t047 = 'z'; 
#endif
*(g063 + z054 - 1) = '\0'; *(g063 + z054 - 2) = '\n'; x054 = g063; while
(*x054) { if (strchr ("\"\'", *x054)) *x054 = ' '; x054++; } if (u040) fprintf
(u040,"\nREPLY: %s\n", g063); 
#ifndef NO_READLINE
*e053 = '\0'; 
#endif
} 
#ifdef __STDC__
void c055 (char *b060, int w054) 
#else
void c055 (b060, w054) char *b060; int w054; 
#endif
{ int k065; if (l051 (w054) == '!') w054++; for (k065 = 1; k065 <= 20; k065++)
if ((*b060++ = l051 (w054++)) == '\0') return; } 
#ifdef __STDC__
void h003 (int y066, int v049) 
#else
void h003 (y066, v049) int y066; int v049; 
#endif
{ int l004; if (o049[v049]) { c055 (y066 == 1 ? e056 : o052, o049 [v049]);
return; } for (l004 = 0; l004 < i006; l004++) { if (u009 [l004] == v049)
{ c055 (y066 == 1 ? e056 : o052, i010 [l004]); return; } } strcpy (y066
== 1 ? e056 : o052, "*GLITCH*"); return; } 
#ifdef __STDC__
void h002 (int d002, int g003, int type) 
#else
void h002 (d002, g003, type) int d002; int g003; int type; 
#endif
{ int f053; int o073; 
#ifdef i004
int m003; 
#endif 
if (d002 == 0 && i003 [q007] != 1) return; o073 = -1; 
#ifdef i004
m003 = (d002 == 2) ? q004 + 1 : q005; if (m003 > z009) goto y067; for (f053
= m003; f053 <= z009; f053++) { 
#if j000 >= 11 && defined (t009)
if (c044 > 0) { int i, j; j = 0; for (i = 0; i < c044; i++) if (f053 ==
x049 [i]) { x049 [i] = x049 [c044 - 1]; c044--; j = 1; break; } if (j) continue;
} 
#endif 
#else 
for (f053 = q005; f053 <= z009; f053++) { 
#endif 
#ifdef s006
if ((f006 [f053] == g003 || (g003 != a006 && o002 (f053, s006) && f006 [f053]
+ 1 == g003)) && 
#else
if (f006 [f053] == g003 && 
#endif
(type < 0 || o002 (f053, type))) { if (o073 >= 0) { 
#if j000 > 1
i003 [n006] = x004; 
#else
i003 [n006] = m008; 
#endif
return; } o073 = f053; if (d002) break; } } if (o073 >= 0) { i003 [n006]
= o073; c055 (o052, o049 [o073]); 
#ifdef k001
if (i003 [k001] || z046) { char *m060 = o052; while (*m060) i052 (m060++);
} 
#endif 
o052 [19] = '\0'; i003 [q007] = 2; 
#ifdef s007
i003 [s007] = o073; 
#endif
#ifdef i004
if (d002 > 0) q004 = o073; if (d002 == 1) { g052 = g003; o056 = type; }
#endif 
return; } 
#ifdef i004
y067: if (d002 > 0) q004 = 0; 
#endif 
i003 [n006] = 0; return; } 
#if j000 >= 11
#ifdef u007
#ifdef __STDC__
void y068 (int t051, int s056) 
#else
void y068 (t051, s056) int t051; int s056; 
#endif
{ char m061; strncpy (l046, n043 [b054], d044); 
#ifdef k001
if (i003 [k001]) e052 (l046, d044); 
#endif
u001 (v048, u007, v044); c055 (l046, t051); m061 = *(l046 + s056); *(l046
+ s056) = '\0'; u001 (v048, u007, v044); *(l046 + s056) = m061; if ((unsigned
int)s056 >= strlen (l046)) i003 [u007]++; else u001 (v048, u007, v044);
u001 (0, u007, 0); *l046 = '\0'; y056("\n\n"); } 
#endif
#ifdef __STDC__
void b061 (int *type, int *v049, int *k066, int y066, int b062) 
#else
void b061 (type, v049, k066, y066, b062) int *type; int *v049; int *k066;
int y066; int b062; 
#endif
#else 
#ifdef __STDC__
void b061 (int *type, int *v049, int *k066, int y066) 
#else
void b061 (type, v049, k066, y066) int *type; int *v049; int *k066; int
y066; 
#endif
#endif
{ int v053, y069, r068; 
#if j000 > 1
int x058; int d058; 
#endif 
#if j000 >= 11
int v054; int u052; int t051; int s056; 
#endif
int b063; char *m060; int d059; char v055 [d044]; *type = -1; strncpy (v055,
y066 == 0 ? g051 : n043 [b054], d044); if (m053 < 0) { *v049 = m008; goto
e062; } 
#ifdef k001
if (i003 [k001]) e052 (v055, d044); 
#endif 
if (*v055 == '\0') { *type = s004; goto e062; } v053 = -1; r068 = i006 +
1; while (r068 > v053 + 1) { u043++; y069 = (v053 + r068) / 2; if (l051
(b063 = r009 [y069]) == '!') b063++; m060 = v055; while (l051 (b063) ==
*m060) if (*m060 != '\0') { m060++; b063++; } else break; if (l051 (b063)
< *m060 && *m060 != '\0') v053 = y069; else r068 = y069; } *v049 = m008;
v053++; r068 = i006; 
#if j000 > 1
x058 = m008; 
#endif 
while (v053 < r068) { m060 = v055; if (l051 (b063 = r009 [v053]) == '!')
#if j000 == 1
b063++; 
#else
{ b063++; d058 = 1; } else d058 = 0; 
#endif 
d059 = b063; while (*m060 == l051 (d059)) { if (*m060 == '\0') break; else
{ d059++; m060++; } } if (*m060 != '\0') break; 
#if j000 > 1
if (!d058 || (d058 && l051 (d059) == '\0')) 
#else
if (l051 (d059) == '\0' || d059 - b063 >= 5) 
#endif
{ *type = o006 [v053]; *v049 = u009 [v053]; *k066 = i010 [v053]; if (l051
(d059) == '\0') 
#if j000 == 1
{ if (d059 - b063 <= 2) { m060 = v055; while (++v053 < r068) if (*v049 ==
u009 [v053] && *m060 == l051 (r009 [v053])) *k066 = i010 [v053]; } goto
e062; } 
#else 
goto e062; if (x058 != m008 && *v049 != x058) 
#if j000 >= 11
{ 
#define c056(X) (y066 == 1 ? X > z009 : (X <= z009 && \
(f006 [X] == a006 || f006 [X] == i003 [i007])))
int a057 = c056 (x058); int r069 = c056 (*v049); if ((r069 && a057) || (!r069
&& !a057)) { *v049 = x004; goto e062; } if (!r069 && a057) { *v049 = x058;
*k066 = u052; *type = v054; v053++; continue; } if (r069 && !a057) { x058
= *v049; if (l051 (b063) == '\0') break; } } u052 = *k066; v054 = *type;
#endif 
x058 = *v049; 
#endif 
if (l051 (b063) == '\0') break; } v053++; } 
#if j000 >= 11
if (*v049 == m008 && m053 > 0) { char *w055 = NULL; int o074 = 0; x058 =
-1; for (v053 = 0; v053 < i006; v053++) { if (l051 (b063 = r009 [v053])
== '!') continue; m060 = v055; while (*m060 == l051 (b063)) { m060++; b063++;
} if (*m060 == '\0' && l051 (b063 + 1) == 0 && o006 [v053] != s004) { if
(x058 >= 0 && u009 [x058] != u009 [v053]) {x058 = n007; break;} x058 = v053;
t051 = r009 [v053]; s056 = b063 - t051; continue; } w055 = m060; o074 =
b063; if (*m060 == l051 (b063 + 1) && *(m060 + 1) == l051 (b063)) { b063
+= 2; m060 += 2; while (*m060 && *m060 == l051 (b063)) {m060++; b063++;}
if (*m060 == '\0' && l051 (b063) == '\0' && o006 [v053] != s004) { if (x058
>= 0 && u009 [x058] != u009 [v053]) {x058 = n007; break;} x058 = v053; t051
= r009 [v053]; s056 = b063 - t051; continue; } m060 = w055; b063 = o074;
} if (*(m060 + 1) == l051 (b063 + 1)) { m060++; b063++; while (*m060 &&
*m060 == l051 (b063)) {m060++; b063++;} if (*m060 == '\0' && l051 (b063)
== '\0' && o006 [v053] != s004) { if (x058 >= 0 && u009 [x058] != u009 [v053])
{x058 = n007; break;} x058 = v053; t051 = r009 [v053]; s056 = b063 - t051;
continue; } m060 = w055; b063 = o074; } if (*m060 == l051 (b063 + 1)) {
b063++; while (*m060 && *m060 == l051 (b063)) {m060++; b063++;} if (*m060
== '\0' && l051 (b063) == '\0' && o006 [v053] != s004) { if (x058 >= 0 &&
u009 [x058] != u009 [v053]) {x058 = n007; break;} x058 = v053; t051 = r009
[v053]; s056 = b063 - t051; continue; } m060 = w055; b063 = o074; } if (*(m060
+ 1) == l051 (b063) || *(m060 + 1) == '\0') { m060++; while (*m060 && *m060
== l051 (b063)) {m060++; b063++;} if (*m060 == '\0' && l051 (b063) == '\0'
&& o006 [v053] != s004) { if (x058 >= 0 && u009 [x058] != u009 [v053]) {x058
= n007; break;} x058 = v053; t051 = r009 [v053]; s056 = b063 - t051; continue;
} } } if (x058 == n007) *v049 = n007; else if (x058 >= 0) { 
#ifdef u007
*type = o006 [x058]; *v049 = u009 [x058]; *k066 = i010 [x058]; if (b062)
y068 (t051, s056); 
#else
*v049 = m008; 
#endif
} } 
#endif 
e062: 
#if j000 >= 11
if (y066 > 1 && (*v049 == m008 || *v049 == n007) && a053 (n046, n043 [b054]))
i003 [n006] = a008; 
#endif 
if (y066 == 1) m060 = e056; else if (y066 == 2) m060 = o052; else m060 =
g050; if (*v049 <= m008) { strncpy (m060, n043 [b054], d044); if (y066 <=
2 && strlen (n043 [b054]) > 16) strcpy (k053, n043[b054]); } else { c055
(m060, *k066); 
#ifdef k001
if (i003 [k001] || z046) { char *n059 = m060; while (*n059) i052 (n059++);
} 
#endif 
} 
#if defined(t011) && defined(g007) 
if ((*v049 > t011 && *v049 < g007) && l047 [b054 + 1] == ' ') l047 [b054
+ 1] = ';'; 
#endif
return; } 
#ifdef __STDC__
void t052 (void) 
#else
void t052 () 
#endif
{ char *x054, *j049; char z055; for (x054 = q053; *x054; x054++) *x054 =
tolower (*x054); x054 = j049 = q053; while (*x054 == ' ' || *x054 == ','
|| *x054 == ';' || (*x054 == '.' && *(x054 + 1) != '.' && *(x054 + 1) !=
'/' && *(x054 + 1) != '\\')) x054++; while (*x054) { if (*x054 == '.' &&
(*(x054 + 1) == '.' || *(x054 + 1) == '/' || *(x054 + 1) == '\\')) { *j049++
= *x054++; continue; } while (*x054 && *x054 != ' ' && *x054 != ',' && *x054
!= ';' && *x054 != '.' && *x054 != '\n') *j049++ = *x054++; z055 = ' ';
while (*x054 == ' ' || *x054 == ',' || *x054 == ';' || *x054 == '\n' ||
(*x054 == '.' && *(x054 + 1) != '.' && *(x054 + 1) != '/' && *(x054 + 1)
!= '\\')) { if (*x054 == '.') *x054 = ';'; if (z055 == ' ' || *x054 == '\n')
z055 = *x054; else if ((z055 == ' ' || z055 == ',') && (*x054 == ';' ||
*x054 == '\n')) z055 = *x054; x054++; } if (*x054) *j049++ = z055; } if
(z055 != '\n') *j049++ = '\n'; *j049++ = '\0'; *j049 = '\0'; b054 = 0; x054
= q053; while (*x054) { if (*x054 == '\n') break; n043 [b054] = x054; while
(*x054 && *x054 != ' ' && *x054 != ',' && *x054 != ';' && *x054 != '\n')
x054++; l047 [b054 + 1] = *x054; *x054++ = '\0'; if (strcmp (n043 [b054],
f007) == 0) l047 [b054] = i003 [q007] < 90 ? ',' : ' '; else if (strcmp
(n043 [b054], j003) == 0) l047 [b054] = ';'; else b054++; } n043 [b054]
= NULL; l047 [b054] = '\n'; b054 = 0; i003 [k010] = -1; i003 [n006] = -1;
i003 [q007] = 0; return; } 
#ifdef __STDC__
void z005 (int k002) 
#else
void z005 (k002) int k002; 
#endif
{ int type; int v049; int k066; int m062 = 0; if (k002 == -1) goto f058;
#if j000 >= 11
if (i003[q007] == -1 && i003 [u005] == -1) { printf ("\nSorry... This game does not support command line restore.\n\n");
exit (1); } 
#endif 
if (i003 [q007] < 90 || i003 [q007] >= k009) m053 = 1; else if (i003 [q007]
== 99) m053 = 0; else m053 = -1; 
#if j000 >= 11
#if defined (i004) && defined (t009)
if (q004 == 0) c044 = 0; 
#endif
*l046 = '\0'; 
#endif
*z003 (k010) = -1; *z003 (n006) = -1; 
#ifdef i004
if (q004) { h002 (2, g052, o056); if (l047 [b054] == ',') z044 = i003 [k010];
if (q004) return; } else { z044 = i003 [k010]; z045 = i003 [n006]; } 
#else 
z044 = i003 [k010]; z045 = i003 [n006]; 
#endif 
#ifdef t008
if (o002 ((q007), (t008))) { g049 = z044; strncpy (g051, e056, 20); } 
#if defined(y005) && j000 >= 11
else if (t047 > 'b' && *g051 && g049 == 0) b061 (&type, &g049, &k066, 0,
0); 
#endif
else { g049 = 0; *g051 = '\0'; } y001 ('c', (q007), (t008)); 
#endif 
m062 = (b054 != 0 && n043 [b054] && l047 [b054] == ','); if (l047 [b054]
== ';') { i003 [k010] = -1; i003 [n006] = -1; o003 ('\n'); } 
#ifdef m007
y001 ('c', y005, m007); 
#endif
x059: 
#ifdef q008
if (i003 [x003] >= 0) a056 (); else if (g048 && k051 > g048) e055 = k051
= g048; 
#endif 
if (n043 [b054] == NULL) { if (x047 [0] != '\0' && x047 [0] != '\n') strncpy
(o050, x047, 160); q053 [0] = '\0'; while (q053 [0] == '\0' || q053 [0]
== '\n') { 
#ifdef c006
x050 = 0; 
#endif 
#ifdef z048
fprintf (stderr, "(Locates: %d (+%d), faults %d (+%d))\n", u043, u043 -
j048, d047, d047 - n044); j048 = u043; n044 = d047; 
#endif 
k059 (NULL); if (k002) u001 (0, k002, 0); if (! j049) j049 = n045; w052
(q053, 160); strncpy (x047, q053, 160); 
#ifdef y005
if (i003 [y005] && (*q053 == '\n' || *q053 == '\0')) { i003 [q007] = 0;
i003 [k010] = -1; i003 [n006] = -1; return; } 
#endif 
} k059 (NULL); t052 (); } f058: if (n043[b054] == NULL) goto x059; 
#if j000 >= 11
*u041 = '\0'; *l046 = '\0'; b061 (&type, &v049, &k066, l047 [b054] == ','
? 2 : 1, 1); strncpy (u041, n043 [b054], d044 - 1); 
#else
b061 (&type, &v049, &k066, l047 [b054] == ',' ? 2 : 1); 
#endif
b054++; if (type == s004) { if (n043 [b054] == NULL) goto x059; if (l047
[b054] == ' ' || l047 [b054] == ',') goto f058; } 
#ifdef t008
if ((o002 (q007, t008) && v049 <= g006) || m062) { i003 [k010] = z044; i003
[n006] = v049; i003 [q007] = 2; goto c057; } 
#endif 
i003 [k010] = v049; i003 [q007] = 1; d060: 
#if j000 >= 11
*f046 = '\0'; 
#endif
if (l047 [b054] == ' ' && n043 [b054]) { 
#if defined(t010) && defined(i008)
int l057 = m053; if (m053 == 1) m053 = (i003 [k010] < t010 || i003 [k010]
> i008); 
#endif
#if defined(e003) && defined (s008)
if (i003 [k010] > e003 && i003 [k010] < s008) { l047 [b054] = ';'; goto
c057; } 
#endif
#if j000 >= 11
#ifdef d009
if (i003 [k010] == d009) { int i = b054; strcpy (o051, n043 [i]); while
(n043 [i] && (l047[i + 1] == ' ' || l047[i + 1] == ',')) { strcat (o051,
" "); strcat (o051, n043 [i + 1]); if (l047 [i + 1] == ' ') l047 [i + 1]
= ','; i++; } } 
#endif 
*l046 = '\0'; b061 (&type, &v049, &k066, 2, 1); strncpy (f046, n043 [b054],
d044 - 1); 
#else
b061 (&type, &v049, &k066, 2); 
#endif
#if defined(t010) && defined(i008)
m053 = l057; 
#endif
b054++; if (type == s004) goto d060; i003 [n006] = v049; i003 [q007] = 2;
} 
#if defined(t008) || (defined(e003) && defined(s008))
c057: 
#endif
if (i003 [q007] == 1 && g049) { if ((g049 > z009 && i003 [k010] < z009)
|| (g049 < z009 && i003 [k010] > z009)) { i003 [q007] = 2; i003 [n006] =
g049; strncpy (o052, g051, 20); } g049 = 0; *g051 = '\0'; } 
#ifdef c006
if ((i003 [k010] == c006 || i003 [n006] == c006) && b054 > x050) { if (a002[c006]
!= a002[0]) (*a002[c006])(); } if (i003 [k010] == c006 || i003 [n006] ==
c006) { if (n043 [x050] == NULL) goto x059; if (x050 >= b054) goto f058;
x050 = b054; b054 -= i003 [q007] + 1; while (b054 > 0 && l047 [b054] !=
';') b054--;; if (b054 < 0) { if (*o050 == '\n') goto x059; strncpy (q053,
o050, 160); strncpy (x047, o050, 160); t052 (); } goto f058; } 
#endif 
#if defined(t010) && defined(i008)
if (i003 [q007] == 2 && i003 [n006] >= t010 && i003 [n006] <= i008 && (i003
[k010] < t010 || i003 [k010] > i008)) { d003 (29, &i003[0]); if (i003 [n006]
>= m008) { i003 [q007] = 1; i003 [n006] = -1; } } 
#endif
if ( i003 [k010] == m008 || i003 [n006] == m008 
#if j000 > 1
|| i003 [k010] == x004 || i003 [n006] == x004 
#endif
#if j000 >= 11
|| i003 [k010] == n007 || i003 [n006] == n007 
#endif
) n043 [b054] = NULL; 
#if j000 < 11
else if (i003 [q007] == 2 && i003 [n006] <= n005 && i003 [n006] >= b006
&& (i003[k010] > n005 || i003[k010] < b006)) 
#else 
else if (i003 [q007] == 2 && i003 [n006] != a008 && i003 [n006] <= n005
&& i003 [n006] >= b006 && (i003[k010] > n005 || i003[k010] < b006)) 
#endif 
{ int c058; c058 = i003 [k010]; i003 [k010] = i003 [n006]; i003 [n006] =
c058; strncpy (r061, e056, 20); strncpy (e056, o052, 20); strncpy (o052,
r061, 20); } e056 [19] = '\0'; o052 [19] = '\0'; 
#ifdef v000
if (i003[k001]) { e052 (e056, d044); e052 (o052, d044); } 
#endif
if (l047 [b054] == ' ') { 
#if j000 >= 11 && defined(i004) && defined (t009)
if (n043 [b054]) { b061 (&type, &v049, &k066, 3, 0); if (v049 == t009) {
b054++; while (v049 >= 0 && (l047 [b054] == ' ' || l047 [b054] == ','))
{ if (strcmp (n043 [b054], f007) != 0) { b061 (&type, &v049, &k066, 3, 1);
if (v049 <= m008) break; else if (v049 > z009) { v049 = r008; break; } else
{ c055 (g050, k066); x049 [c044++] = v049; } } b054++; } i003 [u005] = -1;
if (v049 <= m008) return; } } 
#endif 
if (n043 [b054] && strcmp (n043 [b054], f007) == 0 && l047 [b054] == ' ')
l047 [++b054] = ','; else if (l047[b054] != ';') { 
#if j000 >= 11
if (i003 [q007] > 1 && (l047 [b054] == ' ' || l047 [b054] == ',')) i003
[q007] = r008; if (n043 [b054]) while (l047 [++b054] == ' '); } } 
#ifdef c006
if (i003 [k010] == -c006 && i003 [q007] > 1) { i003 [k010] = c006; i003
[q007] = r008; } 
#endif 
if (i003 [q007] == r008 || i003 [k010] > q007 || i003 [n006] > q007) n043
[b054 + 1] = NULL; 
#else 
while (l047 [++b054] == ' '); } } 
#endif 
if (i003 [q007] == 1) i003 [n006] = -1; 
#if j000 >= 11
else if (i003 [q007] == r008) { i003 [n006] = -1; } 
#endif
return; } 
#ifdef __STDC__
int c004 (int k002) 
#else
int c004 (k002) int k002; 
#endif
{ char g058 [10]; char *z056; int e063 = -1; if (k002 >= 0) u001 (0, k002,
0); else k059 (NULL); while (e063 < 0) { z049 = 1; w052 (g058, 10); k059
(NULL); 
#ifdef k001
if (i003 [k001]) e052 (g058, 10); 
#endif 
z056 = g058; while (*z056 == ' ') z056++; if (*z056 == '\0' || *z056 ==
'\n') e063 = 1; else if (*z056 == 'y' || *z056 == 'Y') e063 = 1; else if
(*z056 == 'n' || *z056 == 'N') e063 = 0; else if (*z056 == 'q' || *z056
== 'Q') e063 = 0; if (e063 < -1) { y056 ("(OK, smartass... I'll assume you mean YES - so there!)\n \n");
e063 = 1; } if (e063 >= 0) break; y056 ( "Eh? Do me a favour and answer yes or no!\nWhich will it be? ");
e063--; } return e063; } 
#ifdef __STDC__
void o075 (char *c059, char *r070) 
#else
void o075 (c059, r070) char *c059; char *r070; 
#endif
{ char *x054; strcpy (r070, c059); x054 = r070; while (*x054) { if (*x054
== '\n') { *x054 = '\0'; break; } 
#if d000
if (*x054 == '.') *x054 = '_'; 
#endif 
x054++; } 
#ifdef d000
*(r070 + 8) = '\0'; 
#else 
*(r070 + 16) = '\0'; 
#endif 
if (strcmp (r070 + strlen (r070) - 4, ".adv") != 0) strcat (r070, ".adv");
return; } 
#ifdef __STDC__
int r071 (FILE *z057) 
#else
int r071 (z057) FILE *z057; 
#endif
{ int r072 = 0; int j054 = 0; int x060 = 0; int w056 = 0; char *g064 = w003;
char t053 = fgetc (z057); while (1) { if (*g064 == '\0' && t053 == '\n')
return (0); if (! isalnum (t053) && ! isalnum(*g064)) break; if (t053 !=
*g064) return (1); g064++; t053 = fgetc (z057); } while (*g064 && ! isdigit
(*g064)) g064++; while (t053 != '\n' && ! isdigit (t053)) t053 = fgetc (z057);
if (t053 == '\n' && *g064 == '\0') return (0); while (isdigit (*g064) ||
*g064 == '.') { if (*g064 == '.') { r072 = j054; j054 = 0; } else j054 =
10 * j054 + *g064 - '0'; g064++; } while (isdigit (t053) || t053 == '.')
{ if (t053 == '.') { x060 = w056; w056 = 0; } else w056 = 10 * w056 + t053
- '0'; t053 = fgetc (z057); } if (r072 != x060) return (1); if (j054 < w056)
return (1); while (t053 != '\n') t053 = fgetc (z057); return (0); } 
#ifdef __STDC__
int e002 (int d002) 
#else
int e002 (d002) int d002; 
#endif
{ 
#ifdef y005
FILE *y070 = NULL; 
#endif 
static char *k067 = NULL; static char *r073 = NULL; char *e064; 
#ifdef y005
char *m063 = (char *)(d002 < 2 ? ".M.adv" : ".T.adv"); int t054 = 1; 
#endif 
if (d002 < 0) { 
#ifdef y005
if (t047 > 'b') { if ((y070 = fopen (m063, k048)) != NULL) { fclose (y070);
t054 = 0; } return (t054); } 
#endif 
return (k067 ? 0 : 1); } e064 = d002 < 2 ? k067 : r073; if (d002 == 0 ||
d002 == 2) { if (e064 == NULL) { e064 = (char *) malloc (l044); if (e064
== NULL) return (1); if (d002 == 0) k067 = e064; else r073 = e064; } memcpy
(e064, b052, l044); 
#ifdef y005
if (t047 > 'b') { if ((y070 = fopen (m063, m048)) != NULL && fwrite (k067,
1, l044, y070) == l044) t054 = 0; if (y070) fclose (y070); return (t054);
} 
#endif
return (0); } else { 
#ifdef y005
if (t047 > 'b') { if ((e064 = (char *) malloc (l044)) != NULL && (y070 =
fopen (m063, k048)) != NULL && (fread (e064, 1, l044, y070)) == l044) t054
= 0; if (y070) fclose (y070); if (t054) return (1); } else if (e064 == NULL)
return (1); 
#else
if (e064 == NULL) return (1); 
#endif 
memcpy (b052, e064, l044); return (0); } } 
#if j000 > 11
int v056 (int o070) { int i062 = -1; if ((v042 = fopen (y004, k048)) !=
NULL) { if (o070 < 0) i062 = 1; else if (fseek (v042, (long) o070, SEEK_SET)
== 0) i062 = fgetc (v042); fclose (v042); } return (i062); } int j055 (int
o070, char r063) { int i062 = 1; if ((v042 = fopen (y004, f043)) != NULL)
{ int a051; fseek (v042, 0L, SEEK_END); a051 = ftell (v042); if (a051 >
o070) fseek (v042, (long) o070, SEEK_SET); else { o070 -= a051; while (o070--)
fputc ('\0', v042); } fputc (r063, v042); fclose (v042); } return (i062);
} 
#endif 
#ifdef __STDC__
int d003 (int d002, int *w000) 
#else
int d003 (d002, w000) int d002; int *w000; 
#endif
{ static char r070 [168]; char c059 [168]; FILE *q066; int r063, val1, h051;
#if j000 >= 10
int x061; 
#endif 
char x062 [12]; static int g065 = sizeof (time_t); int o059; int b064; char
*x054; int o058; int c060, t055, d061, d062, z058; static int v057; static
long f059; void q067 (); void l058 (); switch (d002) { case 1: case 2: r063
= i003 [n006]; 
#ifndef y005
f060: 
#endif
if (r063 != -1) { if (*k053 && strncmp (k053, o052, 16) == 0) strcpy (c059,
k053); else strcpy (c059, o052); } else 
#ifdef y005
{ printf ("*** Glitch! No save/restore name specified!\n"); *w000 = 3; return
(0); } case 999: case 997: if (d002 > 2) { strncpy (o052, o055, d044 - 1);
o075 (o055, r070); } else o075 (c059, r070); 
#else 
case 999: if (d002 == 999) strncpy (c059, o055, d044 - 1); else if (r063
== -1) { if (d002 == 1) { y056 ("\nName to save game under: "); } else {
#if j000 >= 11
int o058 = -1; o058 = n041 (0, c059); if (o058 == 0) { if (t047 >= 'x')
{ y056("You have no saved games to restore.\n") longjmp (m005, 1); } y056
( "Can't see any saved games here, but you may know of some elsewhere.\n")
} else if (o058 == 1) { i003 [n006] = strlen(c059); goto i063; } else {
y056 ("You have the following saved games: ") if (t047 < 'x') n041 (1, NULL);
} 
#endif 
y056 ("\nName of saved game to restore: "); } w052 (c059, 16); k059 (NULL);
#ifdef k001
if (i003 [k001]) e052 (c059, 16); 
#endif 
if (c059 [0] == '\0' || c059 [0] == '\n') { y056 ("\nChanged your mind, eh?  Fine by me...\n");
*w000 = 3; return (0); } } 
#if j000 >= 11
i063: 
#endif 
o075 (c059, r070); 
#endif 
if ((q066 = fopen (r070, k048)) != NULL) { if (d002 == 2 || d002 == 999
|| d002 == 997) goto x063; fclose (q066); y056 ("\nThere's already a game dumped under that name.\n");
#ifdef y005
*w000 = 2; return (0); 
#else 
y056 ("Do you really mean to overwrite it? "); if (!c004 (-1)) { r063 =
-1; goto f060; } y056 ("\nAs you wish...\n"); 
#endif 
} else if (t047 > 'x' && (d002 == 999 || d002 == 997)) { if (d002 == 999)
return (0); y056 ("Oops! We seem to have lost your current game session!\n");
y056 ("\nSorry about that!\n"); x053(errno); k050(1); exit (255); } if (d002
== 2) { *w000 = 1; return (0); } case 998: if (d002 == 998) { o075 (o055,
r070); 
#ifdef y005
if (i003 [y005] == 0 && t047 > 'b') i003 [y005] = 1; *x048 = i003 [y005];
#endif 
} else { if (d002 != 1) return (0); } if ((q066 = fopen (r070, m048)) ==
NULL) { *w000 = 1; return (1); } time ((time_t *) &x062[0]); fprintf (q066,
"%s\n", w003); r063 = q005; fwrite (&r063, sizeof (int), 1, q066); r063
= z009; fwrite (&r063, sizeof (int), 1, q066); r063 = g006; fwrite (&r063,
sizeof (int), 1, q066); r063 = n005; fwrite (&r063, sizeof (int), 1, q066);
r063 = q006; fwrite (&r063, sizeof (int), 1, q066); r063 = k009; fwrite
(&r063, sizeof (int), 1, q066); *i003 = -1; o059 = 0; n048(x062, sizeof(time_t))
n048(b052, m050) n048(b052 + b051, i054) n048(b052 + d041, q052) n048(b052
+ e054, x046) n048(b052 + h043, i055) 
#ifdef y005
if (t047 > 'b' && d002 == 998) { n048(f045, sizeof(f045)); n048(l045, sizeof(l045));
} 
#endif 
fwrite (&o059, sizeof (int), 1, q066); fwrite (x062, 1, sizeof(time_t),
q066); fwrite (b052, 1, l044, q066); if (t047 > 'b' && d002 == 998) { fwrite
(f045, sizeof (char), sizeof (f045), q066); fwrite (l045, sizeof (char),
sizeof (l045), q066); fwrite (&m052, sizeof (int), 1, q066); 
#if j000 >=11
fwrite (n046, sizeof (short), *n046 - 1, q066); 
#endif
fwrite (o050, sizeof (char), sizeof (o050), q066); fwrite (k053, sizeof
(char), sizeof (k053), q066); } *w000 = (ferror (q066)) ? 1 : 0; fclose
(q066); 
#ifdef q008
if (i003 [x003] >= 0 && g048 && g048 < k051) { strcpy (r070 + strlen(r070)
- 3, "adh"); if (((g048 && k051 > g048 + 4) || (t047 > 'b' && i003 [y005]
<= 1)) && (q066 = fopen (r070, m048))) { int a051 = k051 - g048; fwrite
(&a051, 1, sizeof (int), q066); fwrite (g048, 1, k051 - g048, q066); n048(g048,
a051); fwrite (&o059, 1, sizeof (o059), q066); a051 = e055 - g048; fwrite
(&a051, 1, sizeof (int), q066); fclose (q066); } } 
#endif 
return (*w000); x063: *w000 = 0; 
#ifdef y005
if (t047 == 'x') { if (u040) fprintf (u040, "\nREPLY: restore %s\n", r070);
*r060 = 2; *v043 = i003 [n006]; strncpy (q054, o052, 20); } 
#endif
if (r071 (q066) != 0) { *w000 = 4; return (0); } val1 = 0; h051 = 0; fread
(&r063, sizeof (int), 1, q066); 
#ifdef DEBUG
printf ("FOBJ: image %3d, expected %3d\n", r063, q005); 
#endif 
if (r063 != q005) val1++; fread (&c060, sizeof (int), 1, q066); 
#ifdef DEBUG
printf ("LOBJ: image %3d, expected %3d\n", c060, z009); 
#endif 
if (c060 > z009) val1++; else if (c060 < z009) h051++; fread (&t055, sizeof
(int), 1, q066); 
#ifdef DEBUG
printf ("LLOC: image %3d, expected %3d\n", t055, g006); 
#endif 
if (t055 > g006) val1++; else if (t055 < g006) h051++; fread (&d061, sizeof
(int), 1, q066); 
#ifdef DEBUG
printf ("LVERB: image %3d, expected %3d\n", d061, n005); 
#endif 
if (d061 > n005) val1++; else if (d061 < n005) h051++; fread (&d062, sizeof
(int), 1, q066); 
#ifdef DEBUG
printf ("LVAR: image %3d, expected %3d\n", d062, q006); 
#endif 
if (d062 > q006) val1++; else if (d062 < q006) h051++; fread (&z058, sizeof
(int), 1, q066); 
#ifdef DEBUG
printf ("LTEXT: image %3d, expected %3d\n", z058, k009); 
#endif 
if (z058 > k009) val1++; else if (z058 < k009) h051++; if (val1) { *w000
= 2; fclose (q066); return (0); } b064 = 0; if (t047 < 'x') { *w000 = e002
(2); if (*w000 != 0) return (0); } if (w049 == NULL) { w049 = (char *) malloc
(l044); if (w049 == NULL) return (0); } 
#ifdef DEBUG
puts ("Reading image..."); 
#endif
fread (&b064, sizeof (int), 1, q066); 
#ifdef DEBUG
z050("CHKSAV %d\n", b064) 
#endif
fread (x062, 1, sizeof (x062), q066); if (*((int *)(x062 + 4)) == -1) g065
= 4; else if (*((int *)(x062 + 8)) == -1) g065 = 8; else g065 = sizeof(time_t);
fseek (q066, g065 - 12L, SEEK_CUR); { int e065 = z058 * sizeof (int); int
e066 = (c060 + 1) * sizeof (int); int e067 = e065 + e066; int z059 = z008
* (c060 - q005 + 1) * sizeof (short); int c061 = e067 + z059; int o076 =
f009 * (t055 - c060) * sizeof (short); int q068 = c061 + o076; int g066
= s003 * (d062 - t055) * sizeof (short); int d063 = q068 + g066; fread (w049,
1, d063, q066); } 
#if defined(y005)
if (t047 > 'b' && d002 == 999) { fread (f045, sizeof (char), sizeof (f045),
q066); fread (l045, sizeof (char), sizeof (l045), q066); fread (&m052, sizeof
(int), 1, q066); 
#if j000 >= 11
if (! ferror (q066)) { fread (n046, sizeof (short), 2, q066); if (ferror
(q066)) { *n046 = 3; *(n046 + 1) = 0; } else fread (n046 + 2, sizeof (short),
*n046 - 3, q066); } 
#endif
if (! ferror (q066)) { fread (o050, sizeof (char), sizeof (o050), q066);
} *k053 = '\0'; if (! ferror (q066)) { fread (k053, sizeof (char), sizeof
(k053), q066); } clearerr (q066); } 
#endif 
if (ferror (q066)) { *w000 = 2; return (0); } 
#ifdef DEBUG
puts ("Checking image..."); 
#endif
fclose (q066); o059 = 0; { int e065 = z058 * sizeof (int); int e066 = (c060
+ 1) * sizeof (int); int e067 = e065 + e066; int z059 = z008 * (c060 - q005
+ 1) * sizeof (short); int c061 = e067 + z059; int o076 = f009 * (t055 -
c060) * sizeof (short); int q068 = c061 + o076; int g066 = s003 * (d062
- t055) * sizeof (short); int k068 = s003 * (d061 - t055) * sizeof (short);
n048(x062, g065); n048(w049, e065) n048(w049 + e065, e066) n048(w049 + e067,
z059) n048(w049 + c061, o076) n048(w049 + q068, g066) 
#ifdef y005
if (t047 > 'b' && d002 == 999) { n048(f045, sizeof(f045)); n048(l045, sizeof(l045));
} 
#endif 
if (b064 != o059) { *w000 = 2; return (0); } if (g065 == sizeof(f059)) memcpy
(&f059, x062, g065); else f059 = 1; memset (b052, '\0', l044); memcpy (i003,
w049, (c060 + 1) * sizeof (int)); memcpy (i003 + a005, w049 + (c060 + 1)
* sizeof (int), (t055 - c060) * sizeof (int)); memcpy (i003 + b006, w049
+ (t055 + 1) * sizeof (int), (d061 - t055) * sizeof (int)); memcpy (i003
+ d008, w049 + (d061 + 1) * sizeof (int), (d062 - d061 - 1) * sizeof (int));
memcpy (i003 + z010, w049 + d062 * sizeof (int), (z058 - d062) * sizeof
(int)); memcpy (f006, w049 + e065, e066); memcpy (a004, w049 + e067, z059);
memcpy (y003, w049 + c061, o076); memcpy (w002, w049 + q068, k068); memcpy
((char *)w002 + m051, w049 + q068 + k068, g066 - k068); } 
#ifdef y005
if (d002 == 997) i003 [y005] = 2; 
#endif
#ifdef q008
if (i003 [x003] >= 0) { strcpy (r070 + strlen(r070) - 3, "adh"); if ((q066
= fopen (r070, k048))) { int a051 = 0; int d064 = 0; unsigned char *d; if
(g048) e055 = k051 = g048 + 4; if (h051 == 0) fread (&a051, 1, sizeof (int),
q066); if (a051 > 0) { d064 = 8192 * ((a051 + 8191) / 8192); d = (unsigned
char *)malloc(d064); fread (d, 1, a051, q066); fread (&b064, 1, sizeof (b064),
q066); n048(d, a051); if (o059 == b064) { if (g048) free (g048); g048 =
d; w047 = d064; k051 = g048 + a051; memcpy (a046, b052, sizeof(b052)); fread
(&a051, 1, sizeof (int), q066); e055 = g048 + a051; } else free(d); } fclose
(q066); } } 
#endif 
*w000 = (d002 == 999) ? 999 : 0; return (0); case 3: 
#ifdef y005
o075 (o052, r070); 
#endif 
*w000 = unlink (r070); if (*w000) { printf ("Failed: %s - error code: %d<br>\n",
r070, *w000); system ("pwd"); } strcpy (r070 + strlen(r070) - 3, "adh");
unlink (r070); return (0); case 4: case 5: *w000 = 0; return (0); case 6:
#if j000 < 10
y056("Open at all times.\n"); 
#else
v057 = *w000; 
#endif
return (0); case 7: 
#if j000 < 10
v057 = *w000; 
#else
*w000 = v057; 
#endif
return (0); case 8: 
#if j000 < 10
*w000 = v057; 
#else
time ((time_t *) &x061); *w000 = 1 + (x061 - f059) / 60; 
#endif
return (0); case 9: 
#if j000 < 10
*w000 = 0; 
#else
i003 [k010] = *w000; h003 (1, *w000); 
#endif
return (0); case 10: i003 [n006] = *w000; h003 (2, *w000); return (0); case
11: i003 [n006] = i003 [k010]; strncpy (o052, e056, 20); i003 [q007] = 2;
return (0); case 12: *w000 = (n043[b054] == NULL); return (0); 
#if j000 > 10
case 14: *w000 = v056 (*w000); return (0); case 15: case 16: j055 (*w000,
d002 == 15 ? 1 : 0); return (0); 
#endif 
case 19: r063 = *w000; m054 = r063 < 2 ? r063 : 1 - m054; *w000 = m054;
return (0); case 20: r063 = atoi (o052); *w000 = 0; if (r063 == 0) return
(0); if (r063 < 16) r063 = 16; if (r063 > 1024) r063 = 1024; *w000 = r063;
f048 = r063; if (f048 - 2 * w048 < 16) w048 = (f048 - 16) / 2; if (w048
< 0) w048 = 0; s047 = f048 - 2 * w048; 
#ifndef NO_READLINE
if (!t047 && !d048) { int o070 = s045 - e053; e053 = d052(e053, 2 * s047
+ 1); s045 = e053 + o070; } 
#endif 
return (0); case 21: r063 = atoi (o052); *w000 = 0; if (r063 <0) r063 =
0; if (r063 > 9) r063 = 9; if (f048 - r063 - r063 < 16) r063 = (f048 - 16)
/ 2; if (r063 < 0) r063 = 0; *w000 = r063; w048 = r063; s047 = f048 - r063
- r063; 
#ifndef NO_READLINE
if (!t047 && !d048) { int o070 = s045 - e053; e053 = d052(e053, 2 * s047
+ 1); s045 = e053 + o070; } 
#endif 
return (0); case 22: r063 = atoi (o052); if (r063 < 4) { *w000 = 0; return
(0); } if (r063 > 1024) r063 = 1024; *w000 = r063; d046 = r063; return (0);
case 23: *d043 = *w000; *r060 = i003 [q007]; *s046 = i003 [k010]; strncpy
(o053, e056, 20); if (*r060 == 2) { *v043 = i003 [n006]; strncpy (q054,
o052, 20); } else { *v043 = -1; *q054 = '\0'; } return (0); case 24: *w000
= *d043; i003 [q007] = *r060; i003 [k010] = *s046; i003 [n006] = *v043;
strncpy (e056, o053, 20); strncpy (o052, q054, 20); return (0); case 27:
*w000 = 1; if (*o051) { y056("\nOk - \"") y056(o051) y056("\"\n") *o051
= '\0'; } return (0); case 28: *w000 = e002 (3); return (0); case 29: *w000
= 0; if (i003 [q007] > 1) { r063 = i003 [k010]; i003 [k010] = i003 [n006];
i003 [n006] = r063; for (o058 = 0; o058 < s003; o058++) { r063 = w002 [k010
- b006 + o058]; w002 [k010 - b006 + o058] = w002 [n006 - b006 + o058]; w002
[n006 - b006 + o058] = r063; } strcpy (r061, e056); strcpy (e056, o052);
strcpy (o052, r061); } return (0); case 32: 
#if j000 >= 11 && defined (i004) && defined (t009)
if (c044 == 0) { *w000 = 0; return (0); } for (o058 = 0; o058 < c044; o058++)
{ if (*w000 == x049 [o058]) { *w000 = 1; return (0); } } 
#endif 
*w000 = 0; return (0); case 33: 
#if j000 >= 11
*w000 = e002 (-1); 
#else
*w000 = 0; 
#endif
return (0); case 34: 
#if j000 >= 11
*w000 = n041 (*w000, o052); i003 [n006] = strlen (o052); 
#else
*w000 = 0; 
#endif
return (0); default: z050 ("\n \nGLITCH! Bad special code: %d\n", d002);
return (1); } } 
#ifdef r057
#ifdef __STDC__
void l059 (char *v058) 
#else
void l059 (v058) char *v058; 
#endif
{ FILE *v059; char v060; int r063 = 0; int u053 = 0; int u054 = 0; if ((v059
= fopen (v058, m048)) == NULL) return; while (fgetc (a045) != '{') if (feof
(a045)) return; while (1) { v060 = fgetc (a045); if (feof (a045)) return;
if (isdigit (v060)) { if (u054 == 0) u054 = 1; r063 = 10 * r063 + v060 -
'0'; } else if (v060 == '-' && u054 == 0) u054 = -1; else if (u054) { if
(u054 == -1) r063 = - r063; fputc (r063 & 255, v059); u054 = 0; r063 = 0;
u053++; } if (v060 == '}') break; } fclose (v059); if (u053 != t012) return;
printf ("\nText database %s created.\n\n", l005); exit (0); } 
#ifdef __STDC__
FILE *b065 (char *v061, char *z060, int w057) 
#else
FILE *b065 (v061, z060, w057) char *v061; char *z060; int w057; 
#endif
{ FILE *a058; char *k051; int a051; a051 = strlen (z060) + 1; if (v061 &&
*v061) a051 += strlen (v061) + 1; if ((k051 = (char *) malloc (a051)) ==
NULL) { fprintf (stderr, "Unable to allocate db name buffer!\n"); exit (1);
} if (v061 && *v061) { strcpy (k051, v061); if (w057) { char *x054 = strrchr
(k051, q050); a051 = x054 ? x054 - k051 : 0; } else a051 = strlen (k051);
} else a051 = 0; if (a051) sprintf (k051 + a051, "%c%s", q050, z060); else
strcpy (k051, z060); a058 = fopen (k051, k048); free (k051); return (a058);
} 
#endif 
#if t000
#define c062 "acode"
#else
#define c062 ".acode"
#endif 
#ifdef d000
#define v062 "acode.cfg"
#else
#define v062 "acode.conf"
#endif 
#ifndef l000
void v063 (int f053, char *i003) { if (*(k056 + f053) == NULL) { *(k056
+ f053) = (char *) malloc (strlen (i003) + 1); if (*i003 == '\\') i003++;
else if (*i003 == '\'') { char *k069 = i003 + strlen(i003) - 1; if (*k069
== '\'') *k069 = '\0'; i003++; } strcpy (*(k056 + f053), i003); } } 
#endif 
void m064 (char *g067, char **s057) { int i; char *x054 = g067; int v064;
int g068; *s057 = NULL; *(s057 + 1) = NULL; *(s057 + 2) = NULL; for (i =
0; i < 3; i++) { v064 = 0; g068 = 0; while (*x054 == ' ' || *x054 == '\t')
x054++; if (*x054 == '\0' || *x054 == '\n') break; if (*x054 == '#' && g068
== 0 && v064 == 0) break; if (*x054 == '\\' || *x054 == '\'' || *x054 ==
'"') { if (*x054 == '\\') g068 = 1; else v064 = *x054; x054++; } *(s057
+ i) = x054; if (*x054 == '#' && (v064 || g068)) x054++; g068 = 0; while
(1) { if (*x054 == '\t') *x054 = ' '; if (*x054 == ' ' && g068 == 0 && v064
== 0) break; if (*x054 == '\0' || *x054 == '\n') break; if (*x054 == '#'
&& g068 == 0 && v064 == 0) break; if (*x054 == v064) break; x054++; } *x054++
= '\0'; } } char *w058 (char *a059, int k070) { char *x054 = a059; if (x054
== NULL) return (NULL); while (*x054) { if (k070 == 'L' && *x054 >= 'A'
&& *x054 <= 'Z') *x054 += 'a' - 'A'; else if (k070 == 'U' && *x054 >= 'a'
&& *x054 <= 'z') *x054 += 'A' - 'a'; x054++; } return (a059); } 
#ifndef l000
void v065 (int type, int e068, char *j051, int z061, int *r063) { char h047
[16]; int x061; if (k056 [e068] != NULL) return; if ((type == 'p' && atoi
(j051) > 0) || (type == 'n' && atoi (j051) >= 0)) { x061= atoi (j051); if
(z061 > 0 && x061 > z061) x061 = z061; if (z061 < 0 && x061 < -z061) x061
= -z061; if (r063) *r063 = x061; sprintf (h047, "%d", x061); v063 (e068,
h047); } else if (type == 'b') { if (*j051 == 'T' || *j051 == '1' || *j051
== 'Y' || (*j051 == 'O' && *(j051 + 1) == 'N')) { v063 (e068, "Y"); if (r063)
*r063 = 1; } else if (*j051 == 'F' || *j051 == '0' || *j051 == 'N' || (*j051
== 'O' && *(j051 + 1) == 'F')) { v063 (e068, "N"); if (r063) *r063 = 0;
} } else if (type == 'c') { if (*j051 == 'N' || *j051 == 'F' || *j051 ==
'0') { v063 (e068, "0"); if (r063) *r063 = 0; } else if (*j051 == 'P' ||
*j051 == 'S' || *j051 == '1') { v063 (e068, "1"); if (r063) *r063 = 1; }
else if (*j051 == 'Y' || *j051 == 'T' || *j051 == 'A' || *j051 == '2') {
v063 (e068, "2"); if (r063) *r063 = 2; } else if (*j051 == 'D' || *j051
== '?') { char n061 [2]; if (*r063 < 0) *r063 = 0; if (*r063 > 2) *r063
= 2; *n061 = '0' + *r063; *(n061 + 1) = '\0'; v063 (e068, n061); } } } void
n062 (char *w053) { struct stat e069; char a060[256]; char *r074; int z055
= q050; 
#if t000
z055 = strchr(w053, '/') ? '/' : q050; 
#endif
if (strchr (w053, z055)) { if (stat (w053, &e069) != -1) v063 (l048, w053);
return; } if ((r074 = getenv ("PATH")) != NULL) { char *q069 = r074; char
*f055 = q069; while (1) { while (*f055 && *f055 != ':') f055++; if (f055
- q069 < 255 - strlen (w053)) { strncpy (a060, q069, f055 - q069); 
#if t000
z055 = strchr(a060, '/') ? '/' : q050; 
#endif
*(a060 + (f055 - q069)) = z055; strcpy (a060 + (f055 + 1 - q069), w053);
if (stat (a060, &e069) != -1) { v063 (l048, a060); return; } } if (*f055
== '\0') break; q069 = ++f055; } } } void v066 () { char o077 [256]; char
*m065 [3]; char *x054; FILE *r075 = NULL; 
#ifdef q051
int k071 = 0; char *q070; if (t001) q070 = "/usr/bin/open"; else if (c000)
q070 = "/usr/bin/xdg-open"; else if (t000) q070 = "c:\\windows\\system32\\rundll32.exe url.dll,FileProtocolHandler";
else q070 = "NONE"; 
#endif 
strcpy (o077, r059); if ((x054 = strrchr (o077, q050)) != NULL) { strcpy
(x054 + 1, v062); r075 = fopen (o077, k048); } if (r075 == NULL) { sprintf
(o077, "%s%c%s%c%s", getenv (s044), q050, c062, q050, v062); r075 = fopen
(o077, k048); } if (r075 == NULL) { sprintf (o077, "%s%c%s%c%s", getenv
(s044), q050, c062 + 1, q050, v062); r075 = fopen (o077, k048); } if (r075
== NULL) r075 = fopen (v062, k048); if (r075 == NULL) return; while (fgets
(o077, sizeof(o077) - 1, r075)) { char *j051; *(o077 + strlen(o077) - 1)
= '\0'; m064 (o077, m065); if (*m065 == NULL || *(m065 + 1) == NULL) continue;
w058 (*m065, 'U'); if (strcmp (*m065, "LOG") == 0 || strcmp (*m065, "LOGFILE")
== 0) { int l060 = 0; j051 = *(m065 + 2); x054 = w058 (*(m065 + 1), 'U');
if (k056 [o060] != NULL) continue; if (strcmp (x054, "OFF") == 0 || strcmp
(x054, "NO") == 0 || strcmp (x054, "NONE") == 0) v063 (o060, "N"); if (strcmp
(x054, "APPEND") == 0 || strcmp (x054, "ON") == 0) { v063 (o060, f043);
l060 = 1; } else if (strcmp (x054, "OVERWRITE") == 0 || strcmp (x054, "WRITE")
== 0) { v063 (o060, "w"); l060 = 1; } if (l060) { if (j051 == NULL) sprintf
(m049, "%s.log", o055 + 1); else { struct stat e069; char *j056 = strrchr
(j051, q050); if (stat (j051, &e069) == 0) { if (e069.st_mode & S_IFREG)
strncpy (m049, j051, sizeof (m049)); else if (e069.st_mode & S_IFDIR) sprintf
(m049, "%s%c%s.log", j051, q050, o055 + 1); else *k056[o060] = 'N'; } else
if (j056) { *j056 = '\0'; if (stat (j051, &e069) == 0) { if (e069.st_mode
& S_IFDIR) { *j056 = q050; strncpy (m049, j051, sizeof (m049)); } } else
*k056[o060] = 'N'; } else { strncpy (m049, j051, sizeof (m049)); *(m049
+ sizeof (m049) - 1) = '\0'; } } } } else if (strcmp (*m065, "LAYOUT") ==
0) { if (!*(m065 + 2) || !**(m065 + 2)) continue; j051 = w058 (*(m065 +
2), 'U'); x054 = *(m065 + 1); if (strcmp (x054, "JUSTIFY") == 0) { if (strcmp
(j051, "DEFAULT") == 0 || strcmp (j051, "ANY") == 0) v065 ('b', JUSTIFY,
m054 ? "Y" : "N", 0, NULL); else v065 ('b', JUSTIFY, j051, 0, &m054); }
else if (strcmp (x054, "MARGIN") == 0) v065 ('n', MARGIN, j051, 5, &w048);
else if (strcmp (x054, "WIDTH") == 0) v065 ('p', e057, j051, -30, &f048);
else if (strcmp (x054, "HEIGHT") == 0) v065 ('p', h044, j051, 0, &d046);
s047 = f048 - 2 * w048; } 
#ifdef q051
else if (strcmp (*m065, "BROWSER") == 0) { if (t047 == -1) continue; if
(k071) continue; if (k056 [l048]) continue; x054 = *(m065 + 1); if (strcmp
(x054, "NONE") == 0) { t047 = -1; continue; } if (strcmp(x054, "DEFAULT")
== 0) { k071 = 1; t047 = 'b'; continue; } if ((c000 && !t001 && (strcmp
(*(m065 + 1), "LINUX") == 0)) || (c000 && !t001 && (strcmp (*(m065 + 1),
"UNIX") == 0)) || (t001 && (strcmp (*(m065 + 1), "OSX") == 0)) || (t000
&& (strcmp (*(m065 + 1), "WINDOWS") == 0))) x054 = *(m065 + 2); else continue;
if (*x054 == '$') { x054 = getenv(x054 + 1); if (!x054) continue; } else
n062 (x054); } else if (strcmp (*m065, "COLOUR") == 0 || strcmp (*m065,
"COLOR") == 0) { x054 = w058 (*(m065 + 1), 'U'); j051 = w058 (*(m065 + 2),
'L'); if (strcmp (x054, "BACKGROUND") == 0 || strcmp (x054, "BG") == 0)
v063 (n049, j051); if (strcmp (x054, "TEXT") == 0 || strcmp (x054, "FG")
== 0) v063 (n050, j051); if (strcmp (x054, "PROMPT") == 0) v063 (v045, j051);
if (strcmp (x054, "SURROUND") == 0) v063 (f049, j051); if (strcmp (x054,
"DEBUG") == 0 || strcmp(x054, "DBG") == 0) v063 (c045, j051); } else if
(strcmp (*m065, "SHOW") == 0) { if (! (m065 + 2) || ! *(m065 + 2)) continue;
x054 = w058 (*(m065 + 1), 'U'); j051 = w058 (*(m065 + 2), 'U'); if (strcmp
(x054, "BORDER") == 0) v065 ('b', n051, j051, 0, NULL); if (strcmp (x054,
"BUTTON") == 0) v065 ('b', t048, j051, 0, NULL); else if (strcmp (x054,
"COMPACT") == 0) v065 ('c', s048, j051, 0, &a047); else if (strcmp (x054,
"HISTORY") == 0 || strcmp (x054, "COMMANDS") == 0) v065 ('p', y057, j051,
2000, NULL); else if (strcmp (x054, "WIDTH") == 0) v065 ('p', c046, j051,
-500, NULL); } else if (strcmp (*m065, "TIMEOUT")) { if (! (m065 + 2) ||
! *(m065 + 2)) continue; x054 = w058 (*(m065 + 1), 'U'); j051 = *(m065 +
2); if (strncmp(x054, "INV", 3) == 0) v065 ('p', w050, j051, -20, NULL);
else if (strncmp(x054, "GRACE", 5) == 0) v065 ('p', o061, j051, -2, NULL);
else if (strncmp(x054, "KEEP", 4) == 0) v065 ('p', b055, j051, -1, NULL);
} 
#endif 
} 
#ifdef q051
if (k071) v063 (l048, q070); else if (k056 [l048] == NULL) { char *x054;
if ((x054 = getenv ("BROWSER")) != NULL) v063 (l048, x054); else v063 (l048,
q070); } if (k056 [n049] == NULL) v063 (n049, "#d0e0ff"); if (k056 [n050]
== NULL) v063 (n050, "black"); if (k056 [v045] == NULL) v063 (v045, "red");
if (k056 [c045] == NULL) v063 (c045, "blue"); if (k056 [f049] == NULL) v063
(f049, "#222222"); if (k056 [n051] == NULL) v063 (n051, "Y"); if (k056 [t048]
== NULL) v063 (t048, "Y"); if (k056 [y057] == NULL || atoi (k056 [y057])
<= 0) v063 (y057, "200"); if (k056 [c046] == NULL || atoi (k056 [c046])
<= 500) v063 (c046, "700"); 
#endif 
if (k056 [s048] == NULL) v065 ('c', s048, a048, 0, &a047); if (k056 [o060]
== NULL) v063 (o060, f043 ); if (k056 [w050] == NULL) v063 (w050, "20");
if (k056 [b055] == NULL) v063 (b055, "2"); if (k056 [o061] == NULL) v063
(o061, "2"); if (k056 [JUSTIFY] == NULL) v065 ('b', JUSTIFY, m054 ? "Y"
: "N", 0, NULL); if (k056 [MARGIN] == NULL) v065 ('p', MARGIN, "1", 1, &w048);
if (k056 [e057] == NULL) v065 ('p', e057, "80", 80, &f048); if (k056 [h044]
== NULL) v065 ('p', h044, "24", 24, &d046); 
#ifndef q051
s047 = f048 - 2 * w048; 
#endif
u047 = atoi (k056 [b055]) + atoi (k056 [o061]); } char *m066 [] = { "##################### Config file for A-code games ####################"q049,
"#"q049, "# Values as initally supplied are the ones the game will default to"q049,
"# in the absence of this file. Where equivalent command line options"q049,
"# exist, they override values specified by this config file."q049, "#"q049,
"#######################################################################"q049,
"#"q049, 
#ifndef d000
#if c000
"# Browsers will be checked for in the order in which they are listed,"q049,
"# until one is located. Browsers can be specified by their full pathname,"q049,
"# or just by the executable name. In the latter case they will be"q049,
"# searched for using the search path as specified by the PATH variable."q049,
"# If a pathname contains spaces, the whole pathname must be quoted."q049,
"#"q049, "   BROWSER $BROWSER              # Environment variables get evaluated"q049,
"#  BROWSER NONE                  # Force console mode."q049, 
#if !t001
"#  BROWSER chromium-browser      # Google's chrome"q049, "#  BROWSER firefox               # Mozilla's browser"q049,
"#  BROWSER konqueror             # KDE native browser"q049, 
#endif 
#else 
"# A specific non-default browser may be specified by its full pathname"q049,
"# as in the blow IE example. If the pathname contains spaces, the whole"q049,
"# pathname must be quoted."q049, "#"q049, "#  BROWSER \"C:\\Program Files\\Internet Explorer\\iexplore.exe\""q049,
#endif 
"   BROWSER DEFAULT               # Use my default browser"q049, "#"q049,
"# Browser display colours can be specified by names or by hex RGB codes;"q049,
"# if an RGB code is is used, it must be prefixed with \\#, e.g. \\#d0e0ff"q049,
"# or quoted, e.g. \"#d0e0ff\". And yes, our American friends can use COLOR,"q049,
"# if they like!"q049, "#"q049, "   COLOUR BACKGROUND  \\#d0e0ff   # Pale blue is the default background"q049,
"   COLOUR TEXT           black   # Default output text colour"q049, "   COLOUR PROMPT           red   # Make prompt lines red"q049,
"   COLOUR SURROUND    \"#222222\"  # Dark grey default for surround"q049,
"#"q049, "# Other things to do with browser display. Game commands can be always"q049,
"# submitted simply by pressing the <ENTER> (or <RETURN>) key, but setting"q049,
"# BUTTON to YES, will also show a submit button for those who must have it."q049,
"# The COMPACT setting allows the settings of None, Some, All and Default."q049,
"# suppressing respectively none, some or all blank lines, or accepting"q049,
"# the game's default. The HISTORY value shows how many commands and"q049,
"# responses the browser display should retain."q049, "#"q049, "   SHOW BORDER   Yes             # Show the command area border"q049,
"   SHOW BUTTON   Yes             # Show the submit button"q049, "   SHOW COMPACT  Default         # Accept whatever the game defaults to"q049,
"   SHOW HISTORY  200             # Show up to 200 last commands and responses"q049,
"   SHOW WIDTH    700             # Set display area width to 700 pixels"q049,
"#"q049, "# The log file section is applicable both to the browser and the console"q049,
"# modes. Log file can be OFF (or NO, or NONE) or WRITE or APPEND, the"q049,
"# last two being optionally followed by name or pathname; this may indicate"q049,
"# either a specific logfile or a directory in which the logfile will be"q049,
"# placed. The default logfile name is <game_name>.log and its default"q049,
"# location is ~/" c062 "/<game_name>. "q049, "#"q049, "   LOGFILE NONE                  # No logfile"q049,
"#"q049, "# If the game claims server or browser not responding, you can try adjusting"q049,
"# upwards the TIMEOUT limits. This really ought not be necessary, but"q049,
"# if the machine is busy, memory short and the js engine inefficient, you"q049,
"# never know..."q049, "#"q049, "   TIMEOUT INVOCATION  30        # Up to 30 seconds to fully invoke browser"q049,
"   TIMEOUT KEEPALIVE    2        # Keep-alive pings every 4 seconds"q049,
"   TIMEOUT GRACETIME    2        # Grace time for delayed pings"q049, "#"q049,
"# Finally for the console mode only, some screen layout requirements."q049,
#endif 
"# For the JUSTIFY attribute, the possible values are Yes, No and Default."q049,
"#"q049, "   LAYOUT JUSTIFY DEFAULT        # Accept game's default"q049,
"   LAYOUT MARGIN        1        # Left and right text margin"q049, "   LAYOUT WIDTH        80        # Console window width in columns"q049,
"   LAYOUT HEIGHT       24        # Console window height in lines"q049,
"#"q049, "############################# End of file #############################"q049,
"" }; void m067 (void) { char **o078 = m066; FILE *r075 = fopen (v062, "wb");
if (!r075) return; while (**o078) fputs (*o078++, r075); fclose (r075);
} 
#endif 
#ifdef __STDC__
int j057 (char *r059) 
#else
int j057 (r059) char *r059; 
#endif
{ 
#ifdef MEMORY
int h052; 
#endif
#ifdef w045
char i001 [100]; 
#endif
int f053; 
#ifdef r057
a045 = b065 (r059, l005, 1); if (a045 == NULL) a045 = b065 (c043, l005,
0); 
#if defined(z062)
if (a045 == NULL) a045 = b065 (z062, l005, 0); 
#endif
#if defined(z063)
if (a045 == NULL) a045 = b065 (z063, l005, 0); 
#endif
if (a045 == NULL) a045 = fopen (l005, k048); if (a045 == NULL) { if ((a045
= fopen ("adv6.h", k048))) l059 (l005); else { printf ("Sorry, can't find the %s data file.\n",
l005); x057 (); return (1); } if ((a045 = fopen (l005, k048)) == NULL) {
printf ("Unable to find or construct the data file %s.\n", l005); return
(1); } } 
#ifdef MEMORY
h052 = fread (i001, sizeof (char), t012+1, a045); clearerr (a045); fclose
(a045); if (h052 != t012) { printf ("Wrong data file length: expected %d, got %d.\n",
t012, h052); return (1); } 
#endif 
#ifdef SWAP
f047 [0] = fread (i001, sizeof (char), x051, a045) - 1; u042 [0] = 0; 
#endif 
#ifdef w045
fread (i001, sizeof (char), sizeof (i001), a045); 
#endif 
#endif 
if (k049 && *k049 && (i053 = fopen (k049, k048)) == NULL) { printf ("Sorry, unable to open command file '%s'!\n",
k049); exit (0); } if (i053) { fgets (q053, sizeof (q053), i053); if (strncmp
(q053, "Wiz: ", 5) == 0) m052 = atol (q053 + 5); else if (strncmp (q053,
w003, strlen (w003)) != 0) { printf ("%s: wrong adventure version!\n", k049);
exit (0); } else m052 = atol (q053 + strlen (w003) + 1); } if (t047 < 'w')
{ struct stat e069; 
#if t000
r076 (k055, sizeof(k055)); 
#endif 
chdir (getenv (s044)); if (chdir (c062) != 0 && chdir(c062 + 1) != 0) {
#if !t000 || defined(d000)
mkdir (c062, 0700); 
#else
mkdir (c062); 
#endif 
chdir (c062); } 
#ifndef l000
if (stat (v062, &e069) != 0) { void m067 (void); m067 (); } if (chdir (i058
+ 1) != 0) { 
#if !t000 || defined(d000)
mkdir (i058 + 1, 0700); 
#else
mkdir (i058 + 1); 
#endif 
chdir (i058 + 1); } v066(); 
#endif 
if (t047 <= 0) { putchar ('\n'); for (f053 = 0; f053 < w048; f053++) putchar
(' '); } z050("A-code kernel %s\n", a044); } if (*m049) { 
#ifdef l000 
if (!u040 && (u040 = fopen (m049, f043)) == NULL) 
#else
if (!u040 && (u040 = fopen (m049, k056[o060])) == NULL) 
#endif 
printf ("(Sorry, unable to open log file...)\n"); else if (t047 <= 'x')
fprintf (u040, "%s: %u\n", w003, m052); } if (!n045) n045 = c050 (q055);
j049 = n045; *j049++ = '\n'; x052 = 1; 
#if j000 >= 11
if (!n046) n046 = u048 (NULL); 
#endif 
w046 = *i001; 
#ifdef PLAIN
strcpy (u044, (char *)i001 + 1); 
#else
y055 = 0; if (*i001) y055 = -1; 
#ifdef z011
else u044 [0] = i001 [1] ^ z011; 
#endif
while (++y055 < 80) if ((u044 [y055] = i001 [y055] ^ i001 [y055 + 1]) ==
'\0') break; 
#endif 
if (strcmp (u044, w003) != 0) { printf ("Version stamp mismatch: '%s' != '%s'!\n",
u044, w003); return (1); } n043 [0] = NULL; 
#if j000 < 12
for (f053 = q005; f053 <= z009; f053++) y001 ('s', f053, f011); for (f053
= a005; f053 <= g006; f053++) y001 ('s', f053, l007); 
#endif
#if j000 == 1 && defined(k011)
y001 ('s', q007, k011); 
#endif
for (f053 = 0; (unsigned int)f053 < sizeof (u009) / sizeof (u009 [0]); f053++)
if (u009 [f053] < 0) { u009 [f053] *= -1; y001 ('s', u009 [f053], q009 +
1); } return (0); } void r077 (void) { char w053 [64]; int a051 =sprintf
(w053, "%s.adv", i058) - 1; unlink (w053); *(w053 + a051) = 'h'; unlink
(w053); *(w053 + a051) = 'l'; unlink (w053); } 
#ifndef l000
int u055(int argc, char **argv) { char *x064; int r063; char o079; char
*w059; int j058 = 0; 
#if j000 == 1
*a048 = 'Y'; 
#else
*a048 = 'N'; 
#endif
*(a048 + 1) = '\0'; while (--argc) { argv++; if (**argv != c042 && **argv
!= '-') { if (! t046) { if (*argv) t046 = *argv; } else if (! *m049) { strncpy
(m049, *argv, sizeof (m049)); *(m049 + sizeof (m049) - 1) = '\0'; } continue;
} x064 = *argv + 1; if (*x064 == '-') x064++; w059 = x064 + 1; if (*w059
== '=') w059++; if (!*w059 && strchr ("Brclso", *x064) && *(argv + 1) &&
**(argv + 1) != '-') { argc--; argv++; w059 = *argv; } o079 = *w059; if
(o079 >= 'A' && o079 <= 'Z') o079 += ('a' - 'A'); if (*x064 == 'j') { if
(o079 == '0' || o079 == 'n') m054 = 0; else if (o079 == '1' || o079 == 'y')
m054 = 1; else m054 = 1 - m054; v065 ('b', JUSTIFY, m054 ? "Y" : "N", 0,
NULL); t047 = -1; continue; } else if (*x064 == 'b') { *a048 = (*a048 ==
'Y' ? 'N' : 'Y'); if (o079 == '0' || o079 == 'n') *a048 = '0'; else if (o079
== '1' || o079 == 'y') *a048 = '1'; else if (o079 == '2' || o079 == 'a')
*a048 = '2'; v065 ('c', s048, a048, 0, &a047); continue; } if (*x064 ==
'p') { if (o079 == '0' || o079 == 'n') n042 = 0; else if (o079 == '1' ||
o079 == 'y') n042 = 1; else n042 = 1 - n042; continue; } else if (*x064
== 'n') j058 = 1; else if (*x064 == 'v') { printf ("%s.\n", w003); 
#if defined(i005)
printf ("Acdc translator version %s.\n", i005); 
#else
puts ("Acdc translator version UNKNOWN"); 
#endif 
printf ("A-code kernel version %s.\n", a044); 
#if defined(q010)
#if q010 == 0
puts ("Text database preloaded into the executable."); 
#endif 
#if q010 == 1
puts ("Text database read into memory on startup."); 
#endif 
#if defined(SWAP)
printf ("Text database paged via %d internal 1KB swap buffers.\n", SWAP);
#endif 
#if q010 == 3
puts ("All text read directly from the text database as required."); 
#endif 
#endif 
exit (0); } 
#ifndef NO_SLOW
else if (*x064 == 'o') { t047 = -1; if (o079) { d048 = (atoi (w059)) / 10;
if (d048 >= 960) d048 = 960; else if (d048 >= 480) d048 = 480; else if (d048
>= 240) d048 = 240; else if (d048 >= 120) d048 = 120; else if (d048 >= 60)
d048 = 60; else if (d048 >= 30) d048 = 30; else d048 = 11; } else d048 =
30; } 
#endif 
else if (*x064 == 'l') { if (o079) strncpy (m049, w059, sizeof(m049)); else
sprintf (m049, "%s.log", o055 + 1); *(m049 + sizeof (m049) - 1) = '\0';
v063 (o060, f043); } 
#ifdef q051
else if (*x064 == 'B') { 
#if t000
t047 = 'b'; if (o079) n062 (w059); 
#else 
if (getenv ("DISPLAY")) { t047 = 'b'; if (o079) n062 (w059); } else fputs
( "\n*** No display available ***\nDefaulting to the console mode.\n\n",
stderr); 
#endif 
} 
#endif 
else if (*x064 == 'C') { if (t047 == 0 || t047 == 'b') t047 = -1; z006 =
0; } else if (*x064 == 'h') { printf ("\nUsage: %s [options]\n\nOptions:\n",
r059); puts ("    -n                  force a new game (ignore an aborted one)");
puts ("   [-r]<dumpfile>       restore game from dump"); printf ("    -l[<logfile>]       log the game (by default in ~/"
c062 "/%s/)\n", o055 + 1); 
#ifdef q051
puts ("    -C                  Force console (non-browser) display"); puts
("    -B[browser]         Force display through browser (default)"); 
#endif 
puts ("    -b[0|1|all]         invert or specify blank line suppression level");
puts ("    -p[0|1]             invert or specify pausing before exit");
#ifdef r057
puts ("    -d<dbsdir>          specify dbs directory"); 
#endif 
puts ("    -c<cominfile>       replay game from log"); 
#ifdef q008
if (i056 != -2) puts ("    -u{0|1|none}        override default UNDO status");
#endif 
#ifdef q051
#ifndef d000
puts ("\nThese options force console mode display:"); 
#endif 
#endif 
puts ("    -j[0|1]             invert or specify right-justification of text");
puts ("    -s<W>.<H>[.<M>]     set screen size and margin"); 
#ifndef d000
puts ("    -o[<baudrate>]      set output speed for authentic experience\n");
#endif 
puts ("Two information only options:"); puts ("    -v                  print version info and exit");
puts ("    -h                  print this usage summary\n"); exit (0); }
else if (*x064 == 's') { t047 = -1; r063 = strtol (w059, &w059, 10); if
(r063 == 0) r063 = 32767; if (r063 >= 16 && r063 <= 32767) { f048 = r063;
v063 (e057, w059); } if (*w059++) { r063 = strtol (w059, &w059, 10); if
(r063 == 0) r063 = 32767; if (r063 >= 16 && r063 <= 32767) { d046 = r063;
v063 (h044, w059); } if (*w059++) { r063 = strtol (w059, &w059, 10); if
(r063 >= 0 && r063 < (f048 - 16 )/ 2) { w048 = r063; v063 (MARGIN, w059);
} } s047 = f048 - 2 * w048; } } 
#ifdef r057
else if (*x064 == 'd') c043 = w059; 
#endif 
else if (*x064 == 'c') k049 = w059; else if (*x064 == 'r') { if (*w059)
t046 = w059; } 
#ifdef q008
else if (*x064 == 'u' && i056 != -2) { if (o079 == '0' || strcmp (w059,
"off") == 0) i056 = -1; else if (o079 == '2' || o079 == 'n' || strcmp (w059,
"forbid") == 0) i056 = -2; else if (o079 == '1' || strcmp (w059, "on") ==
0) i056 = 1; } 
#endif 
#ifdef y005
else if (*x064 == 'x' || *x064 == 'y') { t047 = *x064; strncpy (a049, w059,
sizeof (a049)); if (*m049 == '\0') { strcpy (m049, o055 + 1); strcat (m049,
".log"); v063 (o060, f043); } } 
#endif 
} return (j058); } 
#endif 
#if t001 && !defined(l000)
extern void l061(int); 
#endif 
#ifdef l000
#ifdef __STDC__
char *b066 (char *i064) 
#else
char *b066 (i064) char *i064; 
#endif
#else
#ifdef __STDC__
int main (int argc, char **argv) 
#else
int main (argc, argv) int argc; char **argv; 
#endif
#endif 
{ int j058 = 0; if (!n045) { n045 = c050 (q055); j049 = n045; } *n045 =
'\0'; strncpy (i058, t007, sizeof (i058) - 1); *(i058 + sizeof(i058) - 1)
= '\0'; 
#if t000 || d000
*i058 = '_'; 
#else
*i058 = '.'; 
#endif 
o055 = i058; 
#ifdef l000
t047 = 'y'; strncpy (a049, i064, sizeof (a049)); if (strncmp (i064, "_INFO_",
6) == 0) { if (*(i064 + 6) && *(i064 + 6) != 'H') z006 = 0; y056 (b005);
o003 ('|'); y056 (w003); return (n045); } else if (strncmp (i064, "_LIST_",
6) == 0) { j049 = n045; *n045 = '\0'; n041 (-1, ""); return (n045); } else
if (strncmp (i064, "_RESUME_", 6) == 0) { j058 = -1; *a049 = '\0'; } else
if (strncmp (i064, "_LOAD_", 6) == 0) { t047 = 'w'; i003[q007] = -1; strcpy
(q053, "restore "); strcat (q053, i064 + 6); t046 = q053 + 8; } else if
(strncmp (i064, "_START_", 7) == 0) { t047 = 'x'; if (*(i064 + 7) && *(i064
+ 7) != 'H') z006 = 0; j058 = 1; } r059 = "."; 
#else 
r059 = *argv; strncpy(i058 + 1, strrchr(*argv, q050) + 1, sizeof(i058) -
1); 
#ifdef q051
#if t000
t047 = 'b'; 
#else 
t047 = getenv("DISPLAY") ? 'b' : 0; 
#endif 
#endif
j058 = u055(argc, argv); 
#endif 
if (f048 == 0) f048 = 32767; if (d046 == 0) d046 = 32767; s047 = f048 -
2 * w048; 
#ifndef NO_READLINE
e053 = c050 (2 * s047 + 1); s045 = e053; *s045 = '\0'; 
#endif 
#ifndef NO_SLOW
if (t047 > 0) d048 = 0; if (d048) 
#if t000
d048 = 1000/d048; 
#else 
d048 = 1000000/d048; 
#endif 
#endif 
if (t047 > 0) w048 = 0; if (m052 == 0) time ((time_t *) &m052); k054 = m052
%= 32768L; e001 (1); if (k049 && !j058) j058 = 1; memset (b052, '\0', sizeof
(b052)); if (j057 (r059) != 0) { printf ("Sorry, unable to set up the world.\n");
return (0); } if (t047 == -1) t047 = 0; i003 [s005] = i003 [i007] = a005;
i003[0] = 0; if (t047 < 'x' && !j058) { if (! t046 || ! *t046) d003(999,
&i003 [0]); } if ((i003[0] == 999 && !k049) || j058 < 0) { FILE *c053; char
w053 [64]; int c; y056 (a050); sprintf (w053, "%s.adl", i058); if ((c053
= fopen (w053, k048)) != NULL) { while ((c = fgetc(c053)) != EOF) o003 (c
& 0377); fclose (c053); } 
#ifdef m046
k050(0); return (f044); 
#else
goto b067; 
#endif 
} 
#ifdef m046
if (j058) i003[q007] = -2; 
#endif 
#ifdef y005
if (t047 == 'x' && t046 && *t046) { o055 = t046; d003 (997, &i003 [0]);
o055 = i058; } else if (t047 == 'y') d003 (999, &i003 [0]); else 
#endif 
{ if (t046 && *t046) { s009 (); i003 [q007] = -1; i003 [u005] = -1; b054
= 1; n043[0] = t046; strncpy (o052, t046, d044); *(o052 + d044 - 1) = '\0';
} else { b054 = 0; n043 [0] = NULL; if (setjmp (m005) == 0) s009 (); } }
b067: 
#ifdef q008
if (i056 == -2) y001 ('s', x003, v002); else if (i056 == 1) y001 ('s', x003,
u006); else if (i056 == -1) { y001 ('s', x003, u006); y001 ('s', x003, r007);
} 
#endif 
#ifdef l000
{ if (t047 == 'w') t047 = 'x'; int o080 = setjmp (m005); if (o080 > 1) return
(f044); } 
#else
setjmp (m005); 
#endif 
if (o057) { if (n042) { y056 ("(To exit, press ENTER)"); w052 (q053, 160);
putchar('\n'); } else { if (x052 > 0) k050 (1); putchar('\n'); } x057 ();
r077 (); 
#if t000
chdir(k055); 
#endif 
#ifdef l000
*f044 = 'f'; o057 = 0; return (f044); 
#else
free (n045); free (f044); if (w049) free (w049); 
#if t001 && !defined(l000)
if (t047 <= 'b') l061(2); 
#endif 
return (255); 
#endif
} while (1) { k054 = m052; e001 (1); m052 = k054; k054 = m052 ^ 255; y007
(); } } 
#ifdef __STDC__
int g002 (int r001,int o000,int y000) 
#else
int g002 (r001,o000,y000) int r001; int o000; int y000; 
#endif
{ if (r001 > z009) return (0); if (f006 [r001] != a006) return (0); if (o000
< 0) return (1); if (o000 == 0) { if (i003 [r001] == y000) return (1); }
else if (o002 (r001, y000)) return (1); return (0); } 
#ifdef __STDC__
int w001 (int r001,int o000,int y000, int z001) 
#else
int w001 (r001,o000,y000,z001) int r001; int o000; int y000; int z001; 
#endif
{ if (r001 > z009) return (0); if (o000 != -1) { if (o000 == 0) { if (i003
[r001] != y000) return (0); } else if (!(o002 (r001, y000))) return (0);
} if (f006 [r001] == z001) return (1); 
#ifdef s006
if (z001 == a006 || !(o002 (r001, s006))) return (0); if (f006 [r001] +
1 == z001) return (1); 
#endif
return (0); } 
#ifdef __STDC__
int k003 (int r001,int o000,int y000) 
#else
int k003 (r001,o000,y000) int r001; int o000; int y000; 
#endif
{ return (w001 (r001, o000, y000, i003 [i007])); } 
#ifdef __STDC__
int l003 (int r001,int o000,int y000) 
#else
int l003 (r001,o000,y000) int r001; int o000; int y000; 
#endif
{ if (g002 (r001,o000,y000)) return (1); if (k003 (r001,o000,y000)) return
(1); return (0); } 
#if !defined(NOVARARGS) && defined(__STDC__)
void d006 (int s001, int x001, ...) { va_list g054; int o081; int x064;
va_start (g054, x001); if (x001 < 0) goto c063; o081 = 0; while (!o081)
{ if ((x064 = va_arg (g054, int)) < 0) { x064 = -x064; o081 = 1; } if (e004
(x064)) goto c063; } va_end (g054); return; c063: va_end (g054); 
#else 
#ifdef __STDC__
void d006 (int s001,int x001,int t004,int c005,int d005,int h053,int e070,int
z064, int w060,int t056,int r078,int h054,int i065,int e071,int t057,int
x065) 
#else
void d006 (s001,x001,t004,c005,d005,h053,e070,z064,w060,t056,r078,h054,i065,e071,t057,x065)
int s001,x001,t004,c005,d005,h053,e070,z064,w060,t056,r078,h054,i065,e071,t057,x065;
#endif
{ int x064; if (x001 < 0) goto c063; if ((x064 = t004) < 0) x064 = -x064;
if (e004 (x064)) goto c063; else if (t004 < 0) return; if ((x064 = c005)
< 0) x064 = -x064; if (e004 (x064)) goto c063; else if (c005 < 0) return;
if ((x064 = d005) < 0) x064 = -x064; if (e004 (x064)) goto c063; else if
(d005 < 0) return; if ((x064 = h053) < 0) x064 = -x064; if (e004 (x064))
goto c063; else if (h053 < 0) return; if ((x064 = e070) < 0) x064 = -x064;
if (e004 (x064)) goto c063; else if (e070 < 0) return; if ((x064 = z064)
< 0) x064 = -x064; if (e004 (x064)) goto c063; else if (z064 < 0) return;
if ((x064 = w060) < 0) x064 = -x064; if (e004 (x064)) goto c063; else if
(w060 < 0) return; if ((x064 = t056) < 0) x064 = -x064; if (e004 (x064))
goto c063; else if (t056 < 0) return; if ((x064 = r078) < 0) x064 = -x064;
if (e004 (x064)) goto c063; else if (r078 < 0) return; if ((x064 = h054)
< 0) x064 = -x064; if (e004 (x064)) goto c063; else if (h054 < 0) return;
if ((x064 = i065) < 0) x064 = -x064; if (e004 (x064)) goto c063; else if
(i065 < 0) return; if ((x064 = e071) < 0) x064 = -x064; if (e004 (x064))
goto c063; else if (e071 < 0) return; if ((x064 = t057) < 0) x064 = -x064;
if (e004 (x064)) goto c063; else if (t057 < 0) return; if ((x064 = x065)
< 0) x064 = -x064; if (e004 (x064)) goto c063; return; c063: 
#endif 
#if j000 >= 11
if (i003 [s005] != i003 [i007]) { *n046 = 3; *(n046 + 1) = 0; } 
#endif 
i003 [s005] = i003 [i007]; *z003 (s005) = -1; i003 [i007] = s001; *z003
(i007) = -1; 
#if defined (m006) && defined (q007)
y001 ('s', q007, m006); 
#endif 
if (x001 < -2) x001 = -x001; if (x001 > 0) u001 (0, x001, 0); if (x001 !=
-1) longjmp (m005, 1); return; } 
#ifdef __STDC__
void a000 (int r001,int o000) 
#else
void a000 (r001,o000) int r001,o000; 
#endif
{ 
#if defined (a007) && defined (q007)
if (f006 [r001] == a006 || o000 == a006) y001 ('s', q007, a007); 
#endif
f006 [r001] = (o000 <= g006 || o000 == a006) ? o000 : i003 [o000]; return;
} 
#ifdef __STDC__
void n002 (char r002, int r003, char h001, int q000, int *t003, short *k004)
#else
void n002 (r002, r003, h001, q000, t003, k004) int r002, r003, h001, q000;
int *t003; short *k004; 
#endif
{ int r063, r079, h055 = 0; if (h001 == 'e') { r063 = i003 [q000]; r079
= 0; } else if (h001 == 'c') { r063 = q000; r079 = 0; } else if (h001 ==
'v') { r063 = i003 [q000]; if (q000 == k010 || q000 == n006) r079 = -1;
else r079 = w002 [s003 * (q000 - b006)]; } else { r063 = t003 [q000]; r079
= k004 [s003 * q000]; } if (r002 == 'V') { i003 [r003] = r063; h055 = w002
[s003 * (r003 - b006)]; } else if (r002 == 'L') { t003 [r003] = r063; h055
= k004 [s003 * r003]; } else i003 [r003] = r063; if (r002 == 'V') { if (r079
== -1 && h055 != -1) w002 [s003 * (r003 - b006)] = -1; else if (r079 !=
-1 && h055 == -1) w002 [s003 * (r003 - b006)] = 0; } else if (r002 == 'L')
{ if (r079 == -1 && h055 != -1) k004 [s003 * r003] = -1; else if (r079 !=
-1 && h055 == -1) k004 [s003 * r003] = 0; } else if (r002 == 'T') { r063
= g047 [2 * (r003 - z010) + 1]; if (r063 <= i003 [r003]) i003 [r003] = r063
- 1; } } 
#ifdef __STDC__
void z002 (int r001, int o000) 
#else
void z002 (r001, o000) int r001,o000; 
#endif
{ i003 [r001] = o000; *z003 (r001) = -1; o049 [r001] = o049 [o000]; return;
} 
#ifdef __STDC__
void f002 (int r001, int o000) 
#else
void f002 (r001, o000) int r001,o000; 
#endif
{ i003 [r001] = i003 [i003 [o000]]; return; } 
#ifdef __STDC__
void f003 (int r001, int o000) 
#else
void f003 (r001, o000) int r001,o000; 
#endif
{ i003 [i003 [r001]] = (o000 > q006 || o000 < d008) ? o000 : i003 [o000];
return; } 
#ifdef __STDC__
void d004 (int r001, int o000) 
#else
void d004 (r001, o000) int r001,o000; 
#endif
{ i003 [r001] = f006 [(o000 < d008 || o000 > q006) ? o000 : i003 [o000]];
*z003 (r001) = -1; return; } 
#ifdef __STDC__
int b001 (int r001) 
#else
int b001 (r001) int r001; 
#endif
{ if (*z003 (r001) == -1) return i003 [r001]; else return r001; } 
#ifdef __STDC__
int o001 (int r001, int *o000, short *y000) 
#else
int o001 (r001, o000, y000) int r001; int *o000; short *y000; 
#endif
{ if (*(y000 + s003 * r001) == -1) return (*(o000 + r001)); else return
r001; } 
#ifdef __STDC__
void r005 (void) 
#else
void r005 () 
#endif
{ 
#if !defined(MEMORY) && !defined(m047)
fclose (a045); 
#endif 
#ifdef z048
fprintf (stderr, "(Locates: %d (+%d), faults %d (+%d))\n", u043, u043 -
j048, d047, d047 - n044); fprintf (stderr, "(Locate ratio %d%%)\n", (((1000
* d047) / u043) + 5) / 10); 
#endif 
o057 = 1; longjmp (m005, 1); } 
#ifdef __STDC__
short *z003 (int s001) 
#else
short *z003 (s001) int s001; 
#endif
{ short *j059; j059 = NULL; if (s001 <= z009) j059 = &a004 [z008 * (s001
- q005)]; else if (s001 <= g006) j059 = &y003 [f009 * (s001 - a005)]; else
if (s001 <= q006) j059 = &w002 [s003 * (s001 - b006)]; return (j059); }
#ifdef __STDC__
void y001 (char s001, int x001, int t004) 
#else
void y001 (s001, x001, t004) char s001; int x001; int t004; 
#endif
{ short *b068; if (x001 > q006) { printf ( "*** Run-time glitch! Setting flag on a flagless entity %d! ***\n",
x001); return; } 
#if j000 >= 20
if (x001 <= g006) { if (t004 < 3) { printf ( "*** Run-time glitch! Attempting to modify major type of entity %d!\n",
x001); return; } t004 -= 3; } 
#endif
b068 = z003 (x001); while (t004 > 15) { b068++; t004 -= 16; } if (s001 ==
's') *b068 |= 1 << t004; else *b068 &= ~(1 << t004); return; } 
#ifdef __STDC__
void g001 (int r004, char s001, int x001, int t004, int *c005, short *d005)
#else
void g001 (r004, s001, x001, t004, c005, d005) int r004; char s001; int
x001; int t004; int *c005; short *d005; 
#endif
{ short *b068; if (x001 < 0 || x001 >= r004) { printf ( "*** Run-time glitch! Local entity %d >= locals %d! ***\n",
x001, r004); return; } if (*(d005 + s003 * x001) == -1) { x001 = *(c005
+ x001); 
#if j000 >= 20
if (x001 <= g006) { if (t004 < 3) { printf ( "*** Run-time glitch! Attempting to modify major type of entity %d!\n",
x001); return; } t004 -= 3; } 
#endif
b068 = z003 (x001); } else b068 = d005 + s003 * x001; while (t004 > 15)
{ b068++; t004 -= 16; } if (s001 == 's') *b068 |= 1 << t004; else *b068
&= ~(1 << t004); return; } 
#ifdef __STDC__
int o002 (int s001, int x001) 
#else
int o002 (s001, x001) int s001; int x001; 
#endif
{ short *b068; if (s001 > q006) return (0); 
#if j000 >= 10
if (s001 <= n005) { if (x001 == 0) return (s001 <= z009 && s001 >= q005);
else if (x001 == 1) return (s001 <= g006 && s001 >= a005); else if (x001
== 2) return (s001 >= b006); 
#if j000 >= 20
x001 -= 3; 
#endif
} 
#endif
b068 = z003 (s001); if (b068 == NULL) return (0); while (x001 > 15) { b068++;
x001 -= 16; } return (*b068 & 1 << x001); } 
#ifdef __STDC__
int b002 (int s001, int x001, int *t004, short *c005) 
#else
int b002 (s001, x001, t004, c005) int s001; int x001; int *t004; short *c005;
#endif
{ short *b068; if (*(c005 + s003 * s001) == -1) { s001 = *(t004 + s001);
if (s001 <= n005) { if (x001 == 0) return (s001 <= z009 && s001 >= q005);
else if (x001 == 1) return (s001 <= g006 && s001 >= a005); else if (x001
== 2) return (s001 >= b006); 
#if j000 >= 20
x001 -= 3; 
#endif
} b068 = z003 (s001); } else b068 = c005 + s003 * s001; if (b068 == NULL)
return (0); while (x001 > 15) { b068++; x001 -= 16; } return (*b068 & 1
<< x001); } 
#ifdef __STDC__
void z004 (void) 
#else
void z004 () 
#endif
{ q004 = 0; n043 [b054] = NULL; return; } 
#ifdef __STDC__
void i052 (char *j051) 
#else
void i052 (j051) char *j051; 
#endif
{ if ((*j051 >= 'a' && *j051 < 'z') || (*j051 >= 'A' && *j051 < 'Z')) (*j051)++;
else if (*j051 == 'z' || *j051 == 'Z') *j051 -= 25; } 
#ifdef __STDC__
void e052 (char *j051, int g069) 
#else
void e052 (j051, g069) char *j051; int g069; 
#endif
{ char *q069 = j051; while (g069-- && *j051) { if ((*j051 > 'a' && *j051
<= 'z') || (*j051 > 'A' && *j051 <= 'Z')) (*j051)--; else if (*j051 == 'a'
|| *j051 == 'A') *j051 += 25; j051++; } if (u040) fprintf (u040, "TRANSLATION: %s\n",
q069); } 
#ifdef __STDC__
void j001 (int i001, int k006) 
#else
void j001 (i001, k006) int i001; int k006; 
#endif
{ g047 [2 * (i001 - z010)] = m059; i003 [i001] = k006; } 
#ifdef __STDC__
void g005 (int type, int *w000) 
#else
void g005 (type, w000) int type; int *w000; 
#endif
{ time_t i066; struct tm *n043; switch (type) { case 4: case 5: i066 = time
(NULL); n043 = localtime (&i066); *w000 = (type == 4 ? n043 -> tm_hour :
n043 -> tm_min); break; default: z050 ("GLITCH! Bad svar code: %d\n", type);
} return; } 
#ifdef __STDC__
void k007 (void) 
#else
void k007(); 
#endif
{ while (*(j049 - 1) == '\n') j049--; } 
#ifdef __STDC__
void u056 (void) 
#else
void u056(); 
#endif
{ j049 = n045; *j049 = '\0'; x052 = 0; } 
#ifdef __STDC__
void j002 (int z065) 
#else
void j002(z065); int z065; 
#endif
{ if (z065 == k010) strncpy (e056, n043 [b054 - 1], d044); else if (z065
== n006 && i003 [q007] == 2) strncpy (o052, n043 [b054 - 1], d044); else
if (z065 != n006) { z050 ("GLITCH! Bad ARGn indicator: %d\n", z065); } }
#ifdef __STDC__
int v001 (char *type) 
#else
int v001 (type); char *type; 
#endif
{ if (strcmp(type, "cgi") == 0) 
#ifdef l000
return (0); 
#else
return (t047 && t047 != 'b'); 
#endif 
if (strcmp(type, "doall") == 0) return (q004); if (strcmp(type, "html")
== 0) 
#ifdef m046
return 1; 
#else
#ifdef q051
return (t047 == 'b'); 
#else
return (t047); 
#endif 
#endif 
z050 ("GLITCH! Bad test type: %s\n", type); return (0); } 
#ifdef __STDC__
void e072 (int v049, int t058) 
#else
void e072 (v049, t058) int v049; int t058; 
#endif
{ int i; fprintf (stderr, " - "); for (i = 0; i < 8 * t058 * sizeof(short);
i++) fprintf (stderr, "%c", o002 (v049, i) ? '1' : '0'); } 
#ifdef __STDC__
void t005 (void) 
#else
void t005 () 
#endif
{ int i; FILE *n063; char h047 [80]; sprintf (h047, "%s.rrefs", i058); n063
= fopen (h047 + 1, k048); for (i = q005; i < k009; i++) { if (n063) { fgets
(h047, sizeof(h047) - 1, n063); *(h047 + strlen(h047) - 1) = '\0'; fprintf
(stderr, "%25s %4d", h047 + 8, i); } else { fprintf (stderr, "%4d", i);
} fprintf (stderr, "%5d", *(i003 + i)); if (i >= q005 && i <= z009) { e072
(i, z008); fprintf (stderr, " @ %4d", *(f006 + i)); } else if (i >= a005
&& i <= g006 ) e072 (i, f009); else if (i >= d008 && i <= q006 ) e072 (i,
s003); fprintf (stderr, "\n"); } if (n063) fclose (n063); } 
#ifdef q008
#ifdef __STDC__
int b069 (int c064) 
#else
int b069 (c064) int c064; 
#endif
{ int i; if (c064 == 0) { memcpy (y054, f006, i054 * sizeof(int)); return
(0); } for (i = 0; i <= z009; i++) { if ((y054[i] == a006 && f006[i] !=
a006) || (y054[i] != a006 && f006[i] == a006)) return (1); } return (0);
} 
#ifdef __STDC__
int c065 (void) 
#else
int c065 () 
#endif
{ char *a; int r063 = 0; y001 ('c', x003, w004); y001 ('c', x003, l006);
y001 ('c', x003, f010); 
#ifdef i004
if (i003 [n006] == i004) r063 = 32767; else if (i003[q007] > 1) 
#else
if (i003[q007] > 1) 
#endif
{ a = o052; while (*a) { if (*a < '0' || *a >'9') { y001 ('s', x003, w004);
return (-1); } r063 = 10 * r063 + *a++ - '0'; } } else r063 = 1; return
(r063); } 
#ifdef __STDC__
void a001 (void) 
#else
void a001 () 
#endif
{ int o058; int c066; if ((o058 = c065 ()) < 0) return; if (w047 == 0 ||
e055 <= g048 + 4) c066 = 0; else { b069 (0); for (c066 = 0; c066 < o058;
c066++) { if (e055 <= g048 + 4) break; e055 -= 4; while (e055 > g048) {
int j059; e055 -= 4; j059 = 256 * (*e055) + *(e055 + 1); if (j059) *(b052
+ j059) = *(e055 + 2); else break; } e055 += 4; } y001 (b069 (1) ? 's' :
'c', x003, f010); } i003 [x003] = c066; 
#ifdef i004
if (i003 [n006] == i004) o058 = c066; 
#endif
y001 (o058 > c066 ? 's' : 'c', x003, l006); i003[y005] = 0; memcpy (a046,
b052, sizeof (b052)); return; } 
#ifdef __STDC__
void b003 (void) 
#else
void b003 () 
#endif
{ int c066; int o058; if ((o058 = c065 ()) < 0) return; if (e055 == k051)
c066 = 0; else { b069 (0); for (c066 = 0; c066 < o058; c066++) { if (e055
> k051) e055 = k051; while (1) { int j059 = 256 * (*e055) + *(e055 + 1);
e055 += 4; if (j059) *(b052 + j059) = *(e055 - 1); else break; } if (e055
== k051) { c066++; break; } } y001 (b069 (1) ? 's' : 'c', x003, f010); }
i003 [x003] = c066; 
#ifdef i004
if (i003 [n006] == i004) o058 = c066; 
#endif
i003[y005] = 0; y001 (o058 > c066 ? 's' : 'c', x003, l006); } 
#endif 
#ifdef __STDC__
void a003 (int k072) 
#else
void a003 (k072) int k072; 
#endif
{ fprintf (stderr, "\n*GLITCH* Called proc offest %d, but game's offset range is 0 to %d!\n",
k072, j005); 
#if j000 >= 11
if (k072 == m008 || k072 == x004 || k072 == n007 || k072 == a008 || k072
== r008) 
#else
#if j000 > 1
if (k072 == m008 || k072 == x004) 
#else
if (k072 == m008) 
#endif
#endif
{ fprintf (stderr, "   Probable cause: "); if (k072 == m008) fprintf (stderr,
"bad word"); 
#if j000 > 1
if (k072 == x004) fprintf (stderr, "ambiguous word"); 
#endif
#if j000 >= 11
if (k072 == n007) fprintf (stderr, "ambiguous typo"); if (k072 == a008)
fprintf (stderr, "mere scenery word"); if (k072 == r008) fprintf (stderr,
"bad syntax"); 
#endif
fprintf (stderr, " in player command not handled by game's code.\n"); }
fprintf (stderr, "\n"); } 
#if j000 >= 11
#ifdef __STDC__
int k008 (char *string) 
#else
int k008 (string) char *string; 
#endif
{ return (strcmp(u041, string) == 0 || strcmp(f046, string) == 0); } 
#endif 
#ifdef q051
char *d065[] = { "<html><head><title>", "=G", "</title>", "<script type=\"text/javascript\"><!--\n",
"=L", 
#ifdef DEBUG
"var debug = 1;\n", 
#endif 
"var state = 'S';\n", "=M", "var interval = 0;\n", "=C", "var rType = 0;\n",
"var turn = 0;\n", "var wake = 0;\n", "var hpos = 0\n", "var hsiz = 0;\n",
"var hcom = [];\n", "var conbot = 0;\n", "var console = 0;\n", "var command = 0;\n",
"var started = 0;\n", "function scrollit()\n", "   { window.scrollTo(0, conbot.offsetTop); }\n",
"function writeit(text)\n", "   { var newDiv = document.createElement('div'); newDiv.id = 'chunk';\n",
"     newDiv.setAttribute('name', 'chunk'); newDiv.innerHTML = text;\n",
"     document.getElementById('console').insertBefore(newDiv, null); scrollit(); }\n",
"   \n", "function zapit()\n", "   { document.getElementById('comform').innerHTML = ''; }\n",
#ifdef DEBUG
"function report(text)\n", "   { writeit('<span class=\"debug\">' + text + '</span><br>'); }\n",
#endif 
"function shutit(text)\n", "{\n", "   window.clearInterval(interval);\n",
"   timeLimit = 0;\n", "   state = 'X';\n", "   zapit();\n", "   writeit(text + '<div align=center class=\"red\">' +\n",
"      '<input class=\"custom-button\" ' +\n", "      'onclick=\"javascript:self.close()\" id=\"shutit\"' +\n",
"      'type=\"button\" value=\"Close this tab/window\" /><br>' +\n", "      '<span class=\"red\">This button will only work if your ' +\n",
"      ' browser<br> is not being paranoid about security.</span></p>' +\n",
"      '</div>');\n", "   document.getElementById('shutit').focus();\n",
"}\n", "function sendit(text)\n", "{\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report(\"Sending '\" + text + \"'\");\n",
#endif 
"   var http = null;\n", "   try { http = new XMLHttpRequest(); }\n", "   catch(e) {\n",
"      try { http = new ActiveXObject(\"Msxml2.XMLHTTP\"); }\n", "      catch(e) {\n",
"         try { http = new ActiveXObject(\"Microsoft.XMLHTTP\"); }\n", "         catch(e) {\n",
"            shutit('<h2>Sorry, your browser is not compatible with this game!</h2><br>');\n",
"         }\n      }\n   }\n", "   http.onreadystatechange = function(e)\n",
"      {\n", "         if (http.readyState == 4)\n", "         {\n", "            if (http.status == 200)\n",
"               showit (http.responseText);\n", "            else\n", "               shutit('<h2>Server process not responding!</h2><br>');\n",
"         }\n", "      };\n", "   http.open('GET', '/?status=' + escape(text), true);\n",
"   http.send(null);\n", "}\n", "function init()\n", "{\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Entering init');\n", 
#endif 
"   conbot = document.getElementById('conbot');\n", "   console = document.getElementById('console');\n",
"   command = document.getElementById('command');\n", "   command.onkeydown = filter;\n",
"   if (document.getElementsByName('chunk').length > 0)\n", "   {\n", "      wake = 1;\n",
"      state = 'R';\n", "   }\n", "   sendit('0x' + state);\n", "   setAlarm(timeLimit);\n",
"   state = 'R';\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Exiting init');\n", 
#endif 
"}\n", "function filter(event)\n", "{\n", "   var e = event || window.event;\n",
"   var code = (e.charCode || e.keyCode);\n", "   if (code == 38 || code == 63232) \n",
"      code = 1;\n", "   else if (code == 40 || code == 63233)\n", "      code = -1;\n",
"   else \n", "      code = 0;\n", "   \n", "   if (code != 0)\n", "   {\n",
"      hist(code);\n", "      return false;\n", "   }\n", "   return true;\n",
"}\n", "function hist(step)\n", "{\n", "   var h = 2 * hpos;\n", "   hcom[h] = command.value;\n",
"   hpos += step;\n", "   if (hpos < 0) hpos = 0;\n", "   if (hpos > hsiz) hpos = hsiz;\n",
"   h = 2 * hpos;\n", "   if (! hcom[h + 1])\n", "      hcom[h + 1] = hcom[h];\n",
"   command.value = hcom[h];\n", "   return;\n", "}\n", "function checkServer()\n",
"{\n", "   wake++;\n", "   sendit('0x' + wake);\n", "   setAlarm(timeLimit);\n",
"}\n", "function setAlarm(limit)\n", "{\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Entering setAlarm, state is ' + state + ', limit is ' + timeLimit);\n",
#endif 
"   if (interval)\n", "      window.clearInterval(interval);\n", "   if (limit)\n",
"      interval = window.setInterval(checkServer, limit, 2);\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Exiting setAlarm, interval is now ' + interval);\n",
#endif 
"}\n", "function showit(text)\n", "{\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Entering showit');\n", 
#endif 
"   if (text == null || text == '')\n", "   {\n", "      if (state == 'R')\n",
"      {\n", "         writeit(\n", "            '<p><h2>Server process not responding!<br>' +\n",
"            'Please close this window and restart.</h2></p>');\n", "      }\n",
"      window.clearInterval(interval);\n", "      interval = 0;\n", "      state = 'X';\n",
"   }\n", "   else\n", "   {\n", "      var type = text.substr(0, 1);\n",
"      if (type != 'k')\n", "      {\n", "         rType = type;\n", "         writeit(text.substr(1));\n",
"         if (type == 'f')\n", "            shutit('');\n", "         else if (started)\n",
"            document.getElementById('command').focus();\n", "      }\n",
"      setAlarm(timeLimit);\n", "   }\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Exiting showit');\n", 
#endif 
"}\n", "function doit(start)\n", "{\n", 
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Entering doit');\n", 
#endif 
"   var com = command.value;\n", "   var pars;\n", "   if (interval)\n",
"   {\n", "      window.clearInterval(interval);\n", "      interval = 0;\n",
"   }\n", "   turn++;\n", "   pars = turn + 'x' + com;\n", "   hcom[0] = com;\n",
"   var prompt = document.getElementById('prompt');\n", "   if (prompt)\n",
"   {\n", "      var el = document.createElement('span');\n", "      var tx = (rType == 'q' || rType == 'm' ||\n",
"                rType == 'r' || rType == 's') ?\n", "                   prompt.innerHTML : '?';\n",
"      if (rType == 'c') tx = '<br>?';\n", "      el.className = 'query';\n",
"      el.innerHTML = tx + ' ' + com +\n", "          (rType == 't' ? '<br>&nbsp<br>' : '');\n",
"      prompt.parentNode.replaceChild(el, prompt);\n", "      el = null;\n",
"   }\n", "   if (com)\n", "   {\n", "      var i;\n", "      for (i = 1; i < hcom.length; i += 2)\n",
"      {\n", "         if (hcom[i])\n", "         {\n", "            hcom[i - 1] = hcom[i];\n",
"            hcom[i] = '';\n", "         }\n", "      }\n", "      if (hcom[0] == hcom[2])\n",
"         hcom[0] = '';\n", "      else\n", "      {\n", "         hcom.unshift('');\n",
"         hcom.unshift('');\n", "         hsiz++;\n", "      }\n", "      command.value = '';\n",
"   }\n", "   hpos = 0;\n", "   sendit(pars);\n", "   var kids = document.getElementsByName('chunk');\n",
"   if (kids.length > moveLimit)\n", "   {\n", "      kids[0].parentNode.removeChild(kids[0]);\n",
"      hcom.pop();\n", "      hcom.pop();\n", "      hsiz--;\n", "   }\n",
#ifdef DEBUG
"   if (debug > 0)\n", "      report('Exiting doit');\n", 
#endif 
"}\n", "function startit()\n", "{\n", "   document.getElementById('startit').style.display = 'none';\n",
"   document.getElementById('gameview').style.display = 'block';\n", "   document.getElementById('command').focus();\n",
"   started = 1;\n", "}\n", "--></script><style type=\"text/css\">\n*.query{color:",
"=Q", "}\n*.debug{color:", "=D", "}\n*.red{color:red}\ntd.view{width:",
"=W", "px}\n*,input{color:", "=F", "}\ninput{max-width:", "=T", "px;}\ntd,input{background-color:",
"=B", "}\ninput.command{border: ", "=X", "px inset #666666}\n", "</style></head><body bgcolor=\"",
"=S", "\" text=\"", "=F", "\" onLoad=\"javascript:init();\">\n", "<table align=center border=1 height=100% cellpadding=16>",
"<tr><td class=view style=vertical-align:top>\n", "<form autocomplete=\"off\" method=\"get\" ",
"action=\"javascript:doit(1)\" id=\"inform\">", "<div id=startit>\n", "&nbsp;<br>\n",
"<h2 align=center>Welcome to the A-code browser interface</h2>", "<h3 align=center>",
"=V", "</h3>\n", "<p>This interface is can be used entirely from the keyboard, as long \n",
"as the command input field remains in focus. Commands can be submitted\n",
"by pressing the RETURN key and arrow keys can be used to recall and\n",
"edit previous commands.</p>\n", "<p>The appearance of the game can be customized by modifying the A-code\n",
"configuration file <b>acode.conf</b> &ndash; this can be found in\n", "the A-code directory, called either <b>.acode</b> or <b>acode</b>,\n",
"within your home directory.\n", "There you can also find individual game directories called by the\n",
"game name, which is where saved games and log files are stored by\n", "default.</p>\n",
"<p>The configuration file has ample comments to guide you, should\n", "you decide to make any changes. If by any chance this interface\n",
"does not work for you, you can change the browser specification in\n",
"that file to NONE and then run the game in the console mode from a\n",
"terminal window.\n", "</p><p align=center>&nbsp;<br>\n", "<input value='Play ",
"=G", "' type=button class=query ", "onclick=javascript:startit() style=font-size:x-large></p>\n",
"<p>&nbsp;<br>(In case you are wondering why it is not possible to skip\n",
"this intro page &ndash; it's because it is in fact a cunning workaround\n",
"for a browser mis-feature, no names named. By clicking on the 'Play'\n",
"button you will ensure that the browser behaves itself and gives\n", "keyboard focus to where the interface has requested it to be.)</p>\n",
"</div>\n", "<div id=gameview style=display:none>\n", "<div id=\"console\">\n",
"</div>\n<span id=\"comform\">", "<span class=\"query\">?&nbsp;</span><input class=\"command\" ",
"id=\"command\" size=\"", "=I", "\" ", "maxlength=\"160\" type=\"text\">\n",
"=R", "</span><br></span></div><div id=\"conbot\">", "</div></form></td></tr></table></body></html>\n",
"==" }; void n004(void) { int i = 0; char t059 [32]; char a048 [32]; char
b070 [16]; char f061 [16]; char a061 [32]; 
#
#ifdef DEBUG
printf ("=== Entering %s\n", "send_page"); 
#endif 
sprintf (t059, "var moveLimit = %d;\n", atoi (k056 [y057])); sprintf (a048,
"var compact = %d;\n", a047 ? 1 : 0); sprintf (b070, "%d", atoi (k056 [c046])
- 20); sprintf (f061, "%d", atoi (k056 [c046]) / 10 - (*k056[t048] == 'Y'
? 6 : 0)); 
#ifdef DEBUG
sprintf (a061, "var timeLimit = %d;\n", 10000 * atoi (k056 [b055])); 
#else
sprintf (a061, "var timeLimit = %d;\n", 1000 * atoi (k056 [b055])); 
#endif 
d042 = f044 + r058; while (1) { char *x054 = d065[i++]; if (*x054 == '=')
{ int d002 = *(x054 + 1); if (d002 == '=') break; x054 = NULL; switch (d002)
{ case 'G': x054 = b005; break; case 'Q': x054 = k056[v045]; break; case
'D': x054 = k056[c045]; break; case 'B': x054 = k056[n049]; break; case
'F': x054 = k056[n050]; break; case 'S': x054 = k056[f049]; break; case
'W': x054 = k056[c046]; break; case 'T': x054 = b070; break; case 'I': x054
= f061; break; case 'M': x054 = t059; break; case 'C': x054 = a048; break;
case 'X': x054 = *(k056[n051]) == 'Y' ? "1" : "0"; break; case 'R': if (*(k056
[t048]) == 'Y') x054 = r062; break; case 'L': x054 = a061; break; case 'V':
x054 = w003; break; default: fprintf (stderr, "Bad substitution tag in page.html: ='%c'!",
d002); exit (1); } } if (x054) x056 (x054); } *d042 = '\0'; o005 (f044);
#ifdef DEBUG
printf ("=== Exiting %s\n", "send_page"); 
#endif 
} char *q003 (char *h047) { char f062[10]; char *j056; sprintf (f062, "%d",
strlen (h047 + r058)); j056 = h047 + 7 - strlen (f062); sprintf (j056, "%s%s\n",
b050, f062); *(h047 + r058 - 1) = '\n'; return (j056); } void b004() { char
f063 [sizeof(b050) + 20]; strcpy (f063 + r058, "k"); o005 (f063); } 
#endif

