Repository head::
Forward port of Crowther & Woods's 430-point Adventure 2.5.
+ Added -l option for logging.
+ Added command prompt; -o suppresses this.
+
-l:: Log commands to specified file.
+-o:: Old-style. Restores original interface, no prompt.
+
== ENVIRONMENT VARIABLES ==
ADVENTURE::
Path to the text database file describing Colossal Cave.
static void quick_io(void);
void initialise(void) {
- printf("Initialising...\n");
+ if (oldstyle)
+ printf("Initialising...\n");
if(!quick_init()){raw_init(); report(); quick_save();}
finish_init();
}
VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X,
WZDARK = false, ZZWORD;
FILE *logfp;
+bool oldstyle = false;
extern void initialise();
extern void score(long);
/* Options. */
- while ((ch = getopt(argc, argv, "l:")) != EOF) {
+ while ((ch = getopt(argc, argv, "l:o")) != EOF) {
switch (ch) {
case 'l':
logfp = fopen(optarg, "w+");
"advent: can't open logfile %s for write\n",
optarg);
break;
+ case 'o':
+ oldstyle = true;
+ break;
}
}
+#include <stdbool.h>
+
#define LINESIZE 100
extern long ABB[], ATAB[], ATLOC[], BLKLIN, DFLAG, DLOC[], FIXED[], HOLDNG,
PARMS[], PLACE[], PTEXT[], RTEXT[], TABSIZ;
extern signed char INLINE[LINESIZE+1], MAP1[], MAP2[];
extern FILE *logfp;
+extern bool oldstyle;
+#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "main.h"
if(MAP2[1] == 0)MPINIT();
+ if (!oldstyle && isatty(0))
+ fputs("> ", stdout);
IGNORE(fgets(INLINE+1,sizeof(INLINE)-1,OPENED));
if (feof(OPENED)) {
if (logfp)