case 31: goto L8320; /* FLY */
case 32: goto L8330; /* LISTEN */
case 33: goto L8340; /* ZZZZ */
+ case 34: goto L8350; /* SEED */
}
BUG(23);
case 31: goto L9320; /* FLY */
case 32: return(2011); /* LISTEN */
case 33: goto L8340; /* ZZZZ */
+ case 34: goto L8350; /* SEED */
}
BUG(24);
RSPEAK(241);
return(2);
+L8350: printf("I see a SEED command. %s\n", raw_input);
+ return(2);
}
2032 FLY
2033 LISTE
2034 Z'ZZZ (GETS REPLACED)
+2035 SEED (USED IN REPLAY LOGS, NOT INTENDED FOR PLAYER)
3001 FEE
3002 FIE
3003 FOE
#include <stdio.h>
#include <stdbool.h>
#include <getopt.h>
+#include <string.h>
#include "main.h"
#include "misc.h"
PARMS[26], PLACE[101], PTEXT[101], RTEXT[278],
SETUP = 0, TABSIZ = 330;
signed char INLINE[LINESIZE+1], MAP1[129], MAP2[129];
+signed char raw_input[LINESIZE+1];
long ABBNUM, ACTSPK[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, BONUS,
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2,
/* Gee, I don't understand. */
L3000: SETPRM(1,WD1,WD1X);
- RSPEAK(254);
- goto L2600;
+ /* This is a kludge. The command parser we inherited from the base 2.5
+ * barfs on numeric tokens. It will fall through to here when it sees
+ * seed NNNN. Instead of barfing, go straight to the action processor
+ * where it will examine the raw input. This will fo away when we get
+ * rid of the obfuscated FORTRANoid input processing.
+ */
+ if (strncmp(raw_input, "seed", 4) == 0) {
+ I=4090; K=34;
+ goto Laction;
+ } else {
+ RSPEAK(254);
+ goto L2600;
+ }
/* Verb and object analysis moved to separate module. */
KTAB[], *LINES, LINK[], LNLENG, LNPOSN,
PARMS[], PLACE[], PTEXT[], RTEXT[], TABSIZ;
extern signed char INLINE[LINESIZE+1], MAP1[], MAP2[];
+extern signed char raw_input[LINESIZE+1];
extern FILE *logfp;
extern bool oldstyle;
extern lcg_state lcgstate;
#define BUG(NUM) fBUG(NUM)
#undef MAPLIN
void fMAPLIN(FILE *OPENED) {
-long I, VAL;
-
+ signed char *cp;
+
/* Read a line of input, from the specified input source,
* translate the chars to integers in the range 0-126 and store
* them in the common array "INLINE". Integer values are as follows:
if (!oldstyle && SETUP)
fputs("> ", stdout);
- IGNORE(fgets(INLINE+1,sizeof(INLINE)-1,OPENED));
+ IGNORE(fgets(raw_input,sizeof(INLINE)-1,OPENED));
if (feof(OPENED)) {
if (logfp)
fclose(logfp);
} else {
if (logfp)
- IGNORE(fputs(INLINE+1, logfp));
+ IGNORE(fputs(raw_input, logfp));
else if (!isatty(0))
- IGNORE(fputs(INLINE+1, stdout));
- LNLENG=0;
- for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) {
- VAL=INLINE[I]+1;
- INLINE[I]=MAP1[VAL];
- if(INLINE[I] != 0)LNLENG=I;
- } /* end loop */
+ IGNORE(fputs(raw_input, stdout));
+ for (cp = raw_input; *cp; cp++)
+ INLINE[cp - raw_input + 1]=MAP1[*cp + 1];
+ LNLENG = (cp - raw_input);
LNPOSN=1;
}
}