-/* $NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $ */
+/* $NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1993
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
#else
-__RCSID("$NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
+__RCSID("$NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
crcval = step = 0;
}
+/* Process nr bytes at a time; ptr points to them */
unsigned long
-crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
- const char *ptr;
- int nr;
+crc(const char *ptr, int nr)
{
int i;
const char *p;
-/* $NetBSD: done.c,v 1.8 2003/08/07 09:36:50 agc Exp $ */
+/* $NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: done.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
+__RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
#include "extern.h"
int
-score()
+score(void)
{ /* sort of like 20000 */
int scor, i;
mxscor = scor = 0;
return (scor);
}
+/* entry=1 means goto 13000 */ /* game is over */
+/* entry=2 means goto 20000 */ /* 3=19000 */
void
-done(entry) /* entry=1 means goto 13000 */ /* game is over */
- int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
+done(int entry)
{
int i, sc;
if (entry == 1)
exit(0);
}
-
+/* label 90 */
void
-die(entry) /* label 90 */
- int entry;
+die(int entry)
{
int i;
if (entry != 99) {
-/* $NetBSD: hdr.h,v 1.10 2003/08/07 09:36:50 agc Exp $ */
+/* $NetBSD: hdr.h,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
} voc[HTSIZE];
#define SEED 1815622 /* "Encryption" seed */
-struct text
- {
- char *seekadr;/* Msg start in virtual disk */
- int txtlen; /* length of msg starting here */
- };
+struct text {
+ char *seekadr;/* Msg start in virtual disk */
+ int txtlen; /* length of msg starting here */
+};
#define RTXSIZ 205
extern struct text rtext[RTXSIZ]; /* random text messages */
extern struct text stext[LOCSIZ]; /* short loc descriptions */
extern struct travlist { /* direcs & conditions of travel */
- struct travlist *next; /* ptr to next list entry */
- int conditions; /* m in writeup (newloc / 1000) */
- int tloc; /* n in writeup (newloc % 1000) */
- int tverb; /* the verb that takes you there */
- } *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */
+ struct travlist *next; /* ptr to next list entry */
+ int conditions; /* m in writeup (newloc / 1000) */
+ int tloc; /* n in writeup (newloc % 1000) */
+ int tverb; /* the verb that takes you there */
+} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */
extern int atloc[LOCSIZ];
extern int cond[LOCSIZ]; /* various condition bits */
- extern int setbit[16]; /* bit defn masks 1,2,4,... */
+extern int setbit[16]; /* bit defn masks 1,2,4,... */
extern int hntmax;
extern int hints[20][5]; /* info on hints */
-/* $NetBSD: init.c,v 1.14 2003/08/07 09:36:50 agc Exp $ */
+/* $NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1993
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.14 2003/08/07 09:36:50 agc Exp $");
+__RCSID("$NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
int blklin = TRUE;
-int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000,
-010000, 020000, 040000, 0100000};
+int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000,
+ 04000, 010000, 020000, 040000, 0100000};
int datfd; /* message file descriptor */
volatile sig_atomic_t delhit;
int demo, limit;
+/* everything for 1st time run */
void
-init() /* everything for 1st time run */
+init(void)
{
rdata(); /* read data from orig. file */
linkdata();
poof();
}
-char *
-decr(a, b, c, d, e)
- char a, b, c, d, e;
+char *
+decr(int a, int b, int c, int d, int e)
{
static char buf[6];
}
void
-linkdata()
+linkdata(void)
{ /* secondary data manipulation */
int i, j;
closng = panic = closed = scorng = FALSE;
}
-
-
+/* come here if he hits a del */
void
-trapdel(n) /* come here if he hits a del */
- int n __attribute__((__unused__));
+trapdel(int n __attribute__((__unused__)))
{
delhit = 1; /* main checks, treats as QUIT */
signal(SIGINT, trapdel);/* catch subsequent DELs */
void
-startup()
+startup(void)
{
demo = Start();
srand((int) (time((time_t *) NULL))); /* random seed */
-/* $NetBSD: io.c,v 1.15 2003/09/19 10:01:53 itojun Exp $ */
+/* $NetBSD: io.c,v 1.16 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: io.c,v 1.15 2003/09/19 10:01:53 itojun Exp $");
+__RCSID("$NetBSD: io.c,v 1.16 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
#include "extern.h"
+/* get command from user */
+/* no prompt, usually */
void
-getin(wrd1, wrd2) /* get command from user */
- char **wrd1, **wrd2; /* no prompt, usually */
+getin(char **wrd1, char **wrd2)
{
char *s;
static char wd1buf[MAXSTR], wd2buf[MAXSTR];
}
}
+/* confirm with rspeak */
int
-yes(x, y, z) /* confirm with rspeak */
- int x, y, z;
+yes(int x, int y, int z)
{
int result = TRUE; /* pacify gcc */
int ch;
return (result);
}
+/* confirm with mspeak */
int
-yesm(x, y, z) /* confirm with mspeak */
- int x, y, z;
+yesm(int x, int y, int z)
{
int result = TRUE; /* pacify gcc */
int ch;
const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
const char *tape = iotape; /* pointer to encryption tape */
+/* next virtual char, bump adr */
int
-next()
-{ /* next virtual char, bump adr */
+next(void)
+{
int ch;
- ch = (*inptr ^ random()) & 0xFF; /* Decrypt input data */
+ ch = (*inptr ^ random()) & 0xFF; /* Decrypt input data */
if (outsw) { /* putting data in tmp file */
if (*tape == 0)
tape = iotape; /* rewind encryption tape */
char breakch; /* tell which char ended rnum */
+/* "read" data from virtual file */
void
-rdata()
-{ /* "read" data from virtual file */
+rdata(void)
+{
int sect;
char ch;
char nbf[12];
-
+/* read initial location num */
int
-rnum()
-{ /* read initial location num */
+rnum(void)
+{
char *s;
tape = iotape; /* restart encryption tape */
for (s = nbf, *s = 0;; s++)
char *seekhere;
+/* read description-format msgs */
void
-rdesc(sect) /* read description-format msgs */
- int sect;
+rdesc(int sect)
{
int locc;
char *seekstart, *maystart;
outsw = 1; /* these msgs go into tmp file */
for (oldloc = -1, seekstart = seekhere;;) {
maystart = inptr; /* maybe starting new entry */
- if ((locc = rnum()) != oldloc && oldloc >= 0 /* finished msg */
- && !(sect == 5 && (locc == 0 || locc >= 100))) { /* unless sect 5 */
+ if ((locc = rnum()) != oldloc && oldloc >= 0 /* finished msg */
+ /* unless sect 5 */
+ && !(sect == 5 && (locc == 0 || locc >= 100))) {
switch (sect) { /* now put it into right table */
case 1:/* long descriptions */
ltext[oldloc].seekadr = seekhere;
return;
}
if (sect != 5 || (locc > 0 && locc < 100)) {
- if (oldloc != locc) /* starting a new message */
+ if (oldloc != locc) /* starting a new message */
seekstart = maystart;
oldloc = locc;
}
}
}
+/* read travel table */
void
-rtrav()
-{ /* read travel table */
+rtrav(void)
+{
int locc;
struct travlist *t = NULL;
char *s;
int len, m, n, entries = 0;
for (oldloc = -1;;) { /* get another line */
- if ((locc = rnum()) != oldloc && oldloc >= 0) { /* end of entry */
+ /* end of entry */
+ if ((locc = rnum()) != oldloc && oldloc >= 0) {
t->next = 0; /* terminate the old entry */
/* printf("%d:%d entries\n",oldloc,entries); */
/* twrite(oldloc); */
if (locc == -1)
return;
if (locc != oldloc) { /* getting a new entry */
- t = travel[locc] = (struct travlist *) malloc(sizeof(struct travlist));
+ t = travel[locc] = (struct travlist *)
+ malloc(sizeof(struct travlist));
if ( t == NULL)
err(1, NULL);
/* printf("New travel list for %d\n",locc); */
n = atoi(buf); /* newloc mod 1000 = newloc */
} else { /* a long integer */
n = atoi(buf + len - 3);
- buf[len - 3] = 0; /* terminate newloc/1000 */
+ buf[len - 3] = 0; /* terminate newloc/1000 */
m = atoi(buf);
}
while (breakch != LF) { /* only do one line at a time */
if (entries++) {
- t = t->next = (struct travlist *) malloc(sizeof(struct travlist));
+ t = t->next = (struct travlist *)
+ malloc(sizeof(struct travlist));
if (t == NULL)
err(1, NULL);
}
- t->tverb = rnum(); /* get verb from the file */
+ t->tverb = rnum(); /* get verb from the file */
t->tloc = n; /* table entry mod 1000 */
- t->conditions = m; /* table entry / 1000 */
- /* printf("entry %d for %d\n",entries,locc); */
+ t->conditions = m; /* table entry / 1000 */
+ /* printf("entry %d for %d\n",entries,locc); */
}
}
}
#ifdef DEBUG
+/* travel options from this loc */
void
-twrite(loq) /* travel options from this loc */
- int loq;
+twrite(int loq)
{
struct travlist *t;
printf("If");
}
#endif /* DEBUG */
+/* read the vocabulary */
void
-rvoc()
+rvoc(void)
{
- char *s; /* read the vocabulary */
- int index;
+ char *s;
+ int idx;
char buf[6];
for (;;) {
- index = rnum();
- if (index < 0)
+ idx = rnum();
+ if (idx < 0)
break;
- for (s = buf, *s = 0;; s++) /* get the word */
+ for (s = buf, *s = 0;; s++) /* get the word */
if ((*s = next()) == TAB || *s == '\n' || *s == LF
|| *s == ' ')
break;
if (*s != '\n' && *s != LF)
FLUSHLF;/* can be comments */
*s = 0;
- /* printf("\"%s\"=%d\n",buf,index); */
- vocab(buf, -2, index);
+ /* printf("\"%s\"=%d\n",buf,idx); */
+ vocab(buf, -2, idx);
}
/* prht(); */
}
-
+/* initial object locations */
void
-rlocs()
-{ /* initial object locations */
+rlocs(void)
+{
for (;;) {
if ((obj = rnum()) < 0)
break;
}
}
+/* default verb messages */
void
-rdflt()
-{ /* default verb messages */
+rdflt(void)
+{
for (;;) {
if ((verb = rnum()) < 0)
break;
}
}
+/* liquid assets &c: cond bits */
void
-rliq()
-{ /* liquid assets &c: cond bits */
+rliq(void)
+{
int bitnum;
for (;;) { /* read new bit list */
if ((bitnum = rnum()) < 0)
}
void
-rhints()
+rhints(void)
{
int hintnum, i;
hntmax = 0;
void
-rspeak(msg)
- int msg;
+rspeak(int msg)
{
if (msg != 0)
speak(&rtext[msg]);
void
-mspeak(msg)
- int msg;
+mspeak(int msg)
{
if (msg != 0)
speak(&mtext[msg]);
}
+/* read, decrypt, and print a message (not ptext) */
+/* msg is a pointer to seek address and length of mess */
void
-speak(msg) /* read, decrypt, and print a message (not
- * ptext) */
- const struct text *msg; /* msg is a pointer to seek address and length
- * of mess */
+speak(const struct text *msg)
{
char *s, nonfirst;
s = msg->seekadr;
nonfirst = 0;
- while (s - msg->seekadr < msg->txtlen) { /* read a line at a time */
+ while (s - msg->seekadr < msg->txtlen) { /* read a line at a time */
tape = iotape; /* restart decryption tape */
- while ((*s++ ^ *tape++) != TAB); /* read past loc num */
+ while ((*s++ ^ *tape++) != TAB); /* read past loc num */
/* assume tape is longer than location number */
/* plus the lookahead put together */
if ((*s ^ *tape) == '>' &&
if (*tape == 0)
tape = iotape; /* rewind decryp tape */
putchar(*s ^ *tape);
- } while ((*s++ ^ *tape++) != LF); /* better end with LF */
+ } while ((*s++ ^ *tape++) != LF); /* better end with LF */
}
}
-
+/* read, decrypt and print a ptext message */
+/* msg is the number of all the p msgs for this place */
+/* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c */
void
-pspeak(m, skip) /* read, decrypt an print a ptext message */
- int m; /* msg is the number of all the p msgs for
- * this place */
- int skip; /* assumes object 1 doesn't have prop 1, obj 2
- * no prop 2 &c */
+pspeak(int m, int skip)
{
char *s, nonfirst;
- char *numst, save;
+ char *numst;
struct text *msg;
char *tbuf;
nonfirst = 0;
while (s - tbuf < msg->txtlen) { /* read line at a time */
tape = iotape; /* restart decryption tape */
- for (numst = s; (*s ^= *tape++) != TAB; s++); /* get number */
+ for (numst = s; (*s ^= *tape++) != TAB; s++); /* get number */
- save = *s; /* Temporarily trash the string (cringe) */
- *s++ = 0; /* decrypting number within the string */
+ /* Temporarily trash the string (cringe) */
+ *s++ = 0; /* decrypting number within the string */
if (atoi(numst) != 100 * skip && skip >= 0) {
while ((*s++ ^ *tape++) != LF) /* flush the line */
if (*tape == 0)
tape = iotape;
putchar(*s ^ *tape);
- } while ((*s++ ^ *tape++) != LF); /* better end with LF */
+ } while ((*s++ ^ *tape++) != LF); /* better end with LF */
if (skip < 0)
break;
}
-/* $NetBSD: main.c,v 1.18 2004/01/27 20:30:28 jsm Exp $ */
+/* $NetBSD: main.c,v 1.19 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: main.c,v 1.18 2004/01/27 20:30:28 jsm Exp $");
+__RCSID("$NetBSD: main.c,v 1.19 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
#include "hdr.h"
#include "extern.h"
-int main(int, char **);
-
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int i;
int rval, ll;
if (place[eggs] == plac[eggs]
|| (toting(eggs) && loc == plac[eggs]))
goto l2011;
- if (place[eggs] == 0 && place[troll] == 0 && prop[troll] == 0)
+ if (place[eggs] == 0 && place[troll] == 0 &&
+ prop[troll] == 0)
prop[troll] = 1;
k = 2;
if (here(eggs))
case 14: /* 9140 - eat */
if (obj == food)
goto l8142;
- if (obj == bird || obj == snake || obj == clam || obj == oyster
- || obj == dwarf || obj == dragon || obj == troll
- || obj == bear)
+ if (obj == bird || obj == snake || obj == clam
+ || obj == oyster || obj == dwarf || obj == dragon
+ || obj == troll || obj == bear)
spk = 71;
goto l2011;
l9150: case 15:/* 9150 - drink */
if (obj == 0 && liqloc(loc) != water && (liq() != water
- || !here(bottle)))
+ || !here(bottle)))
goto l8000;
if (obj != 0 && obj != water)
spk = 110;
|| k == liqloc(loc))
spk = 94;
for (i = 1; i <= 5; i++)
- if (dloc[i] == loc && dflag >= 2 && obj == dwarf)
+ if (dloc[i] == loc && dflag >= 2
+ && obj == dwarf)
spk = 94;
if (closed)
spk = 138;
-/* $NetBSD: save.c,v 1.8 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: save.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.8 2003/08/07 09:36:51 agc Exp $");
+__RCSID("$NetBSD: save.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
{NULL, 0}
};
+/* Two passes on data: first to get checksum, second */
+/* to output the data using checksum to start random #s */
int
-save(outfile) /* Two passes on data: first to get checksum,
- * second */
- const char *outfile; /* to output the data using checksum to start
- * random #s */
+save(const char *outfile)
{
FILE *out;
struct savestruct *p;
}
int
-restore(infile)
- const char *infile;
+restore(const char *infile)
{
FILE *in;
struct savestruct *p;
-/* $NetBSD: setup.c,v 1.10 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: setup.c,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: setup.c,v 1.10 2003/08/07 09:36:51 agc Exp $";
+static char rcsid[] = "$NetBSD: setup.c,v 1.11 2005/07/01 00:03:36 jmc Exp $";
#endif
#endif /* not lint */
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include "hdr.h" /* SEED lives in there; keep them coordinated. */
+#include "hdr.h" /* SEED lives in there; keep them coordinated. */
#define USAGE "Usage: setup file > data.c (file is typically glorkz)\n"
int main(int, char *[]);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FILE *infile;
int c, count, linestart;
linestart = YES;
while ((c = getc(infile)) != EOF) {
- if (linestart && c == ' ') { /* Convert first spaces to tab */
- printf("0x%02x,", (unsigned int)('\t' ^ random()) & 0xFF);
+ if (linestart && c == ' ') { /* Convert first spaces to tab */
+ printf("0x%02x,",
+ (unsigned int)('\t' ^ random()) & 0xFF);
while ((c = getc(infile)) == ' ' && c != EOF);
/* Drop the non-whitespace character through */
linestart = NO;
-/* $NetBSD: subr.c,v 1.10 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: subr.c,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subr.c,v 1.10 2003/08/07 09:36:51 agc Exp $");
+__RCSID("$NetBSD: subr.c,v 1.11 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
/* Statement functions */
int
-toting(objj)
- int objj;
+toting(int objj)
{
if (place[objj] == -1)
return (TRUE);
}
int
-here(objj)
- int objj;
+here(int objj)
{
if (place[objj] == loc || toting(objj))
return (TRUE);
}
int
-at(objj)
- int objj;
+at(int objj)
{
if (place[objj] == loc || fixed[objj] == loc)
return (TRUE);
}
int
-liq2(pbotl)
- int pbotl;
+liq2(int pbotl)
{
return ((1 - pbotl) * water + (pbotl / 2) * (water + oil));
}
int
-liq()
+liq(void)
{
int i;
i = prop[bottle];
return (liq2(-1 - i));
}
+/* may want to clean this one up a bit */
int
-liqloc(locc) /* may want to clean this one up a bit */
- int locc;
+liqloc(int locc)
{
int i, j, l;
i = cond[locc] / 2;
}
int
-bitset(l, n)
- int l, n;
+bitset(int l, int n)
{
if (cond[l] & setbit[n])
return (TRUE);
}
int
-forced(locc)
- int locc;
+forced(int locc)
{
if (cond[locc] == 2)
return (TRUE);
}
int
-dark()
+dark(void)
{
if ((cond[loc] % 2) == 0 && (prop[lamp] == 0 || !here(lamp)))
return (TRUE);
}
int
-pct(n)
- int n;
+pct(int n)
{
if (ran(100) < n)
return (TRUE);
int
-fdwarf()
+fdwarf(void)
{ /* 71 */
int i, j;
struct travlist *kk;
j = 1 + ran(j);
odloc[i] = dloc[i];
dloc[i] = tk[j];
- dseen[i] = (dseen[i] && loc >= 15) || (dloc[i] == loc || odloc[i] == loc);
+ dseen[i] = (dseen[i] && loc >= 15) ||
+ (dloc[i] == loc || odloc[i] == loc);
if (!dseen[i])
continue; /* i.e. goto 6030 */
dloc[i] = loc;
if (loc == chloc || prop[chest] >= 0)
continue;
k = 0;
- for (j = 50; j <= maxtrs; j++) { /* loop to 6020 */
+ for (j = 50; j <= maxtrs; j++) { /* loop to 6020 */
if (j == pyram && (loc == plac[pyram]
|| loc == plac[emrald]))
goto l6020;
if (place[messag] == 0)
move(chest, chloc);
move(messag, chloc2);
- for (j = 50; j <= maxtrs; j++) { /* loop to 6023 */
+ for (j = 50; j <= maxtrs; j++) { /* loop to 6023 */
if (j == pyram && (loc == plac[pyram]
|| loc == plac[emrald]))
continue;
}
+/* label 8 */
int
-march()
-{ /* label 8 */
+march(void)
+{
int ll1, ll2;
if ((tkk = travel[newloc = loc]) == 0)
goto l11;
}
-
-
+/* 20 */
int
-mback()
-{ /* 20 */
+mback(void)
+{
struct travlist *tk2, *j;
int ll;
if (forced(k = oldloc))
return (2);
}
-
+/* 30000 */
int
-specials()
-{ /* 30000 */
+specials(void)
+{
switch (newloc -= 300) {
case 1: /* 30100 */
newloc = 99 + 100 - loc;
}
}
-
+/* 30300 */
int
-trbridge()
-{ /* 30300 */
+trbridge(void)
+{
if (prop[troll] == 1) {
pspeak(troll, 1);
prop[troll] = 0;
newloc = loc;
return (2);
}
- newloc = plac[troll] + fixd[troll] - loc; /* 30310 */
+ newloc = plac[troll] + fixd[troll] - loc; /* 30310 */
if (prop[troll] == 0)
prop[troll] = 1;
if (!toting(bear))
return (99);
}
-
+/* 20 */
void
-badmove()
-{ /* 20 */
+badmove(void)
+{
spk = 12;
if (k >= 43 && k <= 50)
spk = 9;
}
void
-bug(n)
- int n;
+bug(int n)
{
printf("Please tell jim@rand.org that fatal bug %d happened.\n", n);
exit(1);
}
-
+/* 2600 &c */
void
-checkhints()
-{ /* 2600 &c */
+checkhints(void)
+{
int hint;
for (hint = 4; hint <= hntmax; hint++) {
if (hinted[hint])
}
}
-
+/* 9030 */
int
-trsay()
-{ /* 9030 */
+trsay(void)
+{
int i;
if (*wd2 != 0)
copystr(wd2, wd1);
return (2012);
}
-
+/* 9010 */
int
-trtake()
-{ /* 9010 */
+trtake(void)
+{
if (toting(obj))
return (2011); /* 9010 */
spk = 25;
return (2009);
}
-
+/* 9021 */
int
-dropper()
-{ /* 9021 */
+dropper(void)
+{
k = liq();
if (k == obj)
obj = bottle;
return (2012);
}
+/* 9020 */
int
-trdrop()
-{ /* 9020 */
+trdrop(void)
+{
if (toting(rod2) && obj == rod && !toting(rod))
obj = rod2;
if (!toting(obj))
pspeak(batter, 0);
return (2012);
}
- if (obj == bird && at(dragon) && prop[dragon] == 0) { /* 9025 */
+ if (obj == bird && at(dragon) && prop[dragon] == 0) { /* 9025 */
rspeak(154);
dstroy(bird);
prop[bird] = 0;
prop[troll] = 2;
return (dropper());
}
- if (obj != vase || loc == plac[pillow]) { /* 9027 */
+ if (obj != vase || loc == plac[pillow]) { /* 9027 */
rspeak(54);
return (dropper());
}
return (dropper());
}
-
+/* 9040 */
int
-tropen()
-{ /* 9040 */
+tropen(void)
+{
if (obj == clam || obj == oyster) {
k = 0; /* 9046 */
if (obj == oyster)
return (2010);
}
-
+/* 9120 */
int
-trkill()
-{ /* 9120 */
+trkill(void)
+{
int i;
for (i = 1; i <= 5; i++)
if (dloc[i] == loc && dflag >= 2)
return (8);
}
-
+/* 9170: throw */
int
-trtoss()
-{ /* 9170: throw */
+trtoss(void)
+{
int i;
if (toting(rod2) && obj == rod && !toting(rod))
obj = rod2;
return (9120);
}
-
+/* 9210 */
int
-trfeed()
-{ /* 9210 */
+trfeed(void)
+{
if (obj == bird) {
spk = 100;
return (2011);
return (2011);
}
-
+/* 9220 */
int
-trfill()
-{ /* 9220 */
+trfill(void)
+{
if (obj == vase) {
spk = 29;
if (liqloc(loc) == 0)
return (2011);
}
-
+/* 10000 */
void
-closing()
-{ /* 10000 */
+closing(void)
+{
int i;
prop[grate] = prop[fissur] = 0;
closng = TRUE;
}
-
+/* 11000 */
void
-caveclose()
-{ /* 11000 */
+caveclose(void)
+{
int i;
prop[bottle] = put(bottle, 115, 1);
prop[plant] = put(plant, 115, 0);
-/* $NetBSD: vocab.c,v 1.11 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: vocab.c,v 1.12 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: vocab.c,v 1.11 2003/08/07 09:36:51 agc Exp $");
+__RCSID("$NetBSD: vocab.c,v 1.12 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
#include "extern.h"
void
-dstroy(object)
- int object;
+dstroy(int object)
{
move(object, 0);
}
void
-juggle(object)
- int object;
+juggle(int object)
{
int i, j;
move(object + 100, j);
}
-
void
-move(object, where)
- int object, where;
+move(int object, int where)
{
int from;
}
int
-put(object, where, pval)
- int object, where, pval;
+put(int object, int where, int pval)
{
move(object, where);
return (-1 - pval);
}
void
-carry(object, where)
- int object, where;
+carry(int object, int where)
{
int temp;
void
-drop(object, where)
- int object, where;
+drop(int object, int where)
{
if (object > 100)
fixed[object - 100] = where;
atloc[where] = object;
}
+/* look up or store a word */
+/* -2 for store, -1 for user word, >=0 for canned lookup */
+/* used for storing only */
int
-vocab(word, type, value) /* look up or store a word */
- const char *word;
- int type; /* -2 for store, -1 for user word, >=0 for
- * canned lookup */
- int value; /* used for storing only */
+vocab(const char *word, int type, int value)
{
int adr;
const char *s;
int hash, i;
struct hashtab *h;
- for (hash = 0, s = word, i = 0; i < 5 && *s; i++) /* some kind of hash */
+ for (hash = 0, s = word, i = 0; i < 5 && *s; i++) /* some kind of hash*/
hash += *s++; /* add all chars in the word */
hash = (hash * 3719) & 077777; /* pulled that one out of a hat */
hash %= HTSIZE; /* put it into range of table */
}
}
+/* print hash table */
void
-prht()
-{ /* print hash table */
+prht(void)
+{
int i, j, l;
char *c;
struct hashtab *h;
-/* $NetBSD: wizard.c,v 1.11 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: wizard.c,v 1.12 2005/07/01 00:03:36 jmc Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: wizard.c,v 1.11 2003/08/07 09:36:51 agc Exp $");
+__RCSID("$NetBSD: wizard.c,v 1.12 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
#include "extern.h"
void
-datime(d, t)
- int *d, *t;
+datime(int *d, int *t)
{
time_t tvec;
struct tm *tptr;
char magic[6];
void
-poof()
+poof(void)
{
strcpy(magic, DECR('d', 'w', 'a', 'r', 'f'));
latncy = 45;
}
int
-Start()
+Start(void)
{
int d, t, delay;
return (FALSE);
}
+/* not as complex as advent/10 (for now) */
int
-wizard()
-{ /* not as complex as advent/10 (for now) */
+wizard(void)
+{
char *word, *x;
if (!yesm(16, 0, 7))
return (FALSE);
}
void
-ciao()
+ciao(void)
{
char *c;
char fname[80];
if (save(fname) != 0)
return; /* Save failed */
printf("To resume, say \"adventure %s\".\n", fname);
- printf("\"With these rooms I might now have been familiarly acquainted.\"\n");
+ printf("\"With these rooms I might now have been familiarly ");
+ printf("acquainted.\"\n");
exit(0);
}
int
-ran(range)
- int range;
+ran(int range)
{
long i;