Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/adventure Whn ths cd ws wrttn, thr ws bt shrtg nd vwls...
details: https://anonhg.NetBSD.org/src/rev/465b09795d04
branches: trunk
changeset: 746967:465b09795d04
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Aug 25 06:56:52 2009 +0000
description:
Whn ths cd ws wrttn, thr ws bt shrtg nd vwls wr xtrml xpnsv. Nowadays,
however, we have an ample vowel budget, and bit shortages are a thing
of the past (even in a down economy) so spend a bit to improve
readability.
diffstat:
games/adventure/done.c | 73 ++++++++++++++++++++++++-----------------------
games/adventure/extern.h | 4 +-
games/adventure/hdr.h | 54 +++++++++++++++++-----------------
games/adventure/init.c | 72 +++++++++++++++++++++++-----------------------
games/adventure/io.c | 30 +++++++++---------
games/adventure/main.c | 48 +++++++++++++++---------------
games/adventure/save.c | 20 ++++++------
games/adventure/subr.c | 70 +++++++++++++++++++++++-----------------------
games/adventure/vocab.c | 10 +++---
games/adventure/wizard.c | 10 +++---
10 files changed, 196 insertions(+), 195 deletions(-)
diffs (truncated from 1150 to 300 lines):
diff -r 0ff299ff2579 -r 465b09795d04 games/adventure/done.c
--- a/games/adventure/done.c Tue Aug 25 06:04:17 2009 +0000
+++ b/games/adventure/done.c Tue Aug 25 06:56:52 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -53,8 +53,9 @@
int
score(void)
{ /* sort of like 20000 */
- int scor, i;
- mxscor = scor = 0;
+ int myscore, i;
+
+ maxscore = myscore = 0;
for (i = 50; i <= maxtrs; i++) {
if (ptext[i].txtlen == 0)
continue;
@@ -64,42 +65,42 @@
if (i > chest)
k = 16;
if (prop[i] >= 0)
- scor += 2;
+ myscore += 2;
if (place[i] == 3 && prop[i] == 0)
- scor += k - 2;
- mxscor += k;
+ myscore += k - 2;
+ maxscore += k;
}
- scor += (maxdie - numdie) * 10;
- mxscor += maxdie * 10;
- if (!(scorng || gaveup))
- scor += 4;
- mxscor += 4;
+ myscore += (maxdie - numdie) * 10;
+ maxscore += maxdie * 10;
+ if (!(scoring || gaveup))
+ myscore += 4;
+ maxscore += 4;
if (dflag != 0)
- scor += 25;
- mxscor += 25;
- if (closng)
- scor += 25;
- mxscor += 25;
+ myscore += 25;
+ maxscore += 25;
+ if (isclosing)
+ myscore += 25;
+ maxscore += 25;
if (closed) {
if (bonus == 0)
- scor += 10;
+ myscore += 10;
if (bonus == 135)
- scor += 25;
+ myscore += 25;
if (bonus == 134)
- scor += 30;
+ myscore += 30;
if (bonus == 133)
- scor += 45;
+ myscore += 45;
}
- mxscor += 45;
- if (place[magzin] == 108)
- scor++;
- mxscor++;
- scor += 2;
- mxscor += 2;
- for (i = 1; i <= hntmax; i++)
+ maxscore += 45;
+ if (place[magazine] == 108)
+ myscore++;
+ maxscore++;
+ myscore += 2;
+ maxscore += 2;
+ for (i = 1; i <= hintmax; i++)
if (hinted[i])
- scor -= hints[i][2];
- return (scor);
+ myscore -= hints[i][2];
+ return myscore;
}
/* entry=1 means goto 13000 */ /* game is over */
@@ -113,11 +114,11 @@
if (entry == 3)
rspeak(136);
printf("\n\n\nYou scored %d out of a ", (sc = score()));
- printf("possible %d using %d turns.\n", mxscor, turns);
- for (i = 1; i <= clsses; i++)
+ printf("possible %d using %d turns.\n", maxscore, turns);
+ for (i = 1; i <= classes; i++)
if (cval[i] >= sc) {
speak(&ctext[i]);
- if (i == clsses - 1) {
+ if (i == classes - 1) {
printf("To achieve the next higher rating");
printf(" would be a neat trick!\n\n");
printf("Congratulations!!\n");
@@ -143,9 +144,9 @@
int i;
if (entry != 99) {
rspeak(23);
- oldlc2 = loc;
+ oldloc2 = loc;
}
- if (closng) { /* 99 */
+ if (isclosing) { /* 99 */
rspeak(131);
numdie++;
done(2);
@@ -161,7 +162,7 @@
for (i = 100; i >= 1; i--) {
if (!toting(i))
continue;
- k = oldlc2;
+ k = oldloc2;
if (i == lamp)
k = 1;
drop(i, k);
diff -r 0ff299ff2579 -r 465b09795d04 games/adventure/extern.h
--- a/games/adventure/extern.h Tue Aug 25 06:04:17 2009 +0000
+++ b/games/adventure/extern.h Tue Aug 25 06:56:52 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.11 2009/08/12 04:28:27 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.12 2009/08/25 06:56:52 dholland Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -89,7 +89,7 @@
void caveclose(void);
/* vocab.c */
-void dstroy(int);
+void destroy(int);
void juggle(int);
void move(int, int);
int put(int, int, int);
diff -r 0ff299ff2579 -r 465b09795d04 games/adventure/hdr.h
--- a/games/adventure/hdr.h Tue Aug 25 06:04:17 2009 +0000
+++ b/games/adventure/hdr.h Tue Aug 25 06:56:52 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdr.h,v 1.12 2009/08/12 04:28:27 dholland Exp $ */
+/* $NetBSD: hdr.h,v 1.13 2009/08/25 06:56:52 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -65,11 +65,11 @@
#define FLUSHLINE do { int flushline_ch; while ((flushline_ch = getchar()) != EOF && flushline_ch != '\n'); } while (0)
#define FLUSHLF while (next()!=LF)
-extern int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
+extern int loc, newloc, oldloc, oldloc2, wasdark, gaveup, kq, k, k2;
extern char *wd1, *wd2; /* the complete words */
extern int verb, obj, spk;
extern int blklin;
-extern int saveday, savet, mxscor, latncy;
+extern int saveday, savet, maxscore, latency;
#define SHORT 50 /* How short is a demo game? */
@@ -87,47 +87,47 @@
int txtlen; /* length of msg starting here */
};
-#define RTXSIZ 205
-extern struct text rtext[RTXSIZ]; /* random text messages */
+#define RTXSIZE 205
+extern struct text rtext[RTXSIZE]; /* random text messages */
-#define MAGSIZ 35
-extern struct text mtext[MAGSIZ]; /* magic messages */
+#define MAGSIZE 35
+extern struct text mtext[MAGSIZE]; /* magic messages */
-extern int clsses;
+extern int classes;
#define CLSMAX 12
extern struct text ctext[CLSMAX]; /* classes of adventurer */
extern int cval[CLSMAX];
extern struct text ptext[101]; /* object descriptions */
-#define LOCSIZ 141 /* number of locations */
-extern struct text ltext[LOCSIZ]; /* long loc description */
-extern struct text stext[LOCSIZ]; /* short loc descriptions */
+#define LOCSIZE 141 /* number of locations */
+extern struct text ltext[LOCSIZE]; /* long loc description */
+extern struct text stext[LOCSIZE]; /* 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(...) */
+} *travel[LOCSIZE], *tkk; /* travel is closer to keys(...) */
-extern int atloc[LOCSIZ];
+extern int atloc[LOCSIZE];
extern int plac[101]; /* initial object placement */
extern int fixd[101], fixed[101]; /* location fixed? */
-extern int actspk[35]; /* rtext msg for verb <n> */
+extern int actspeak[35]; /* rtext msg for verb <n> */
-extern int cond[LOCSIZ]; /* various condition bits */
+extern int cond[LOCSIZE]; /* various condition bits */
extern int setbit[16]; /* bit defn masks 1,2,4,... */
-extern int hntmax;
+extern int hintmax;
extern int hints[20][5]; /* info on hints */
extern int hinted[20], hintlc[20];
extern int place[101], prop[101], links[201];
-extern int abb[LOCSIZ];
+extern int abb[LOCSIZE];
extern int maxtrs, tally, tally2; /* treasure values */
@@ -135,22 +135,22 @@
#define TRUE 1
extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
- bird, door, pillow, snake, fissur, tablet, clam, oyster,
- magzin, dwarf, knife, food, bottle, water, oil, plant, plant2,
- axe, mirror, dragon, chasm, troll, troll2, bear, messag,
- vend, batter, nugget, coins, chest, eggs, tridnt, vase,
- emrald, pyram, pearl, rug, chain, spices, back, look, cave,
- null, entrnc, dprssn, /*enter, stream, pour,*/ say, lock, throw,
- find, invent;
+ bird, door, pillow, snake, fissure, tablet, clam, oyster,
+ magazine, dwarf, knife, food, bottle, water, oil, plant, plant2,
+ axe, mirror, dragon, chasm, troll, troll2, bear, message,
+ vend, batter, nugget, coins, chest, eggs, trident, vase,
+ emerald, pyramid, pearl, rug, chain, spices, back, look, cave,
+ null, entrance, depression, /*enter, stream, pour,*/ say, lock,
+ throw, find, invent;
extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
- odloc[7], dflag, daltlc;
+ odloc[7], dflag, daltloc;
extern int tk[21], stick, dtotal, attack;
extern int turns, lmwarn, iwest, knfloc, detail, /* various flags and
* counters */
- abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1,
- clock2, saved, closng, panic, closed, scorng;
+ abbnum, maxdie, numdie, holding, dkill, foobar, bonus, clock1,
+ clock2, saved, isclosing, panic, closed, scoring;
extern int demo, limit;
diff -r 0ff299ff2579 -r 465b09795d04 games/adventure/init.c
--- a/games/adventure/init.c Tue Aug 25 06:04:17 2009 +0000
+++ b/games/adventure/init.c Tue Aug 25 06:56:52 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $ */
+/* $NetBSD: init.c,v 1.19 2009/08/25 06:56:52 dholland Exp $ */
/*-
* Copyright (c) 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $");
+__RCSID("$NetBSD: init.c,v 1.19 2009/08/25 06:56:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -65,66 +65,66 @@
volatile sig_atomic_t delhit;
int yea;
-int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
+int loc, newloc, oldloc, oldloc2, wasdark, gaveup, kq, k, k2;
char *wd1, *wd2; /* the complete words */
int verb, obj, spk;
-int saveday, savet, mxscor, latncy;
+int saveday, savet, maxscore, latency;
Home |
Main Index |
Thread Index |
Old Index