Skip to content

Commit aa19a9d

Browse files
committed
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.
1 parent 84bca70 commit aa19a9d

File tree

10 files changed

+196
-195
lines changed

10 files changed

+196
-195
lines changed

games/adventure/done.c

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
1+
/* $NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
3939
#if 0
4040
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
4141
#else
42-
__RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
42+
__RCSID("$NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -53,8 +53,9 @@ __RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
5353
int
5454
score(void)
5555
{ /* sort of like 20000 */
56-
int scor, i;
57-
mxscor = scor = 0;
56+
int myscore, i;
57+
58+
maxscore = myscore = 0;
5859
for (i = 50; i <= maxtrs; i++) {
5960
if (ptext[i].txtlen == 0)
6061
continue;
@@ -64,42 +65,42 @@ score(void)
6465
if (i > chest)
6566
k = 16;
6667
if (prop[i] >= 0)
67-
scor += 2;
68+
myscore += 2;
6869
if (place[i] == 3 && prop[i] == 0)
69-
scor += k - 2;
70-
mxscor += k;
70+
myscore += k - 2;
71+
maxscore += k;
7172
}
72-
scor += (maxdie - numdie) * 10;
73-
mxscor += maxdie * 10;
74-
if (!(scorng || gaveup))
75-
scor += 4;
76-
mxscor += 4;
73+
myscore += (maxdie - numdie) * 10;
74+
maxscore += maxdie * 10;
75+
if (!(scoring || gaveup))
76+
myscore += 4;
77+
maxscore += 4;
7778
if (dflag != 0)
78-
scor += 25;
79-
mxscor += 25;
80-
if (closng)
81-
scor += 25;
82-
mxscor += 25;
79+
myscore += 25;
80+
maxscore += 25;
81+
if (isclosing)
82+
myscore += 25;
83+
maxscore += 25;
8384
if (closed) {
8485
if (bonus == 0)
85-
scor += 10;
86+
myscore += 10;
8687
if (bonus == 135)
87-
scor += 25;
88+
myscore += 25;
8889
if (bonus == 134)
89-
scor += 30;
90+
myscore += 30;
9091
if (bonus == 133)
91-
scor += 45;
92+
myscore += 45;
9293
}
93-
mxscor += 45;
94-
if (place[magzin] == 108)
95-
scor++;
96-
mxscor++;
97-
scor += 2;
98-
mxscor += 2;
99-
for (i = 1; i <= hntmax; i++)
94+
maxscore += 45;
95+
if (place[magazine] == 108)
96+
myscore++;
97+
maxscore++;
98+
myscore += 2;
99+
maxscore += 2;
100+
for (i = 1; i <= hintmax; i++)
100101
if (hinted[i])
101-
scor -= hints[i][2];
102-
return (scor);
102+
myscore -= hints[i][2];
103+
return myscore;
103104
}
104105

105106
/* entry=1 means goto 13000 */ /* game is over */
@@ -113,11 +114,11 @@ done(int entry)
113114
if (entry == 3)
114115
rspeak(136);
115116
printf("\n\n\nYou scored %d out of a ", (sc = score()));
116-
printf("possible %d using %d turns.\n", mxscor, turns);
117-
for (i = 1; i <= clsses; i++)
117+
printf("possible %d using %d turns.\n", maxscore, turns);
118+
for (i = 1; i <= classes; i++)
118119
if (cval[i] >= sc) {
119120
speak(&ctext[i]);
120-
if (i == clsses - 1) {
121+
if (i == classes - 1) {
121122
printf("To achieve the next higher rating");
122123
printf(" would be a neat trick!\n\n");
123124
printf("Congratulations!!\n");
@@ -143,9 +144,9 @@ die(int entry)
143144
int i;
144145
if (entry != 99) {
145146
rspeak(23);
146-
oldlc2 = loc;
147+
oldloc2 = loc;
147148
}
148-
if (closng) { /* 99 */
149+
if (isclosing) { /* 99 */
149150
rspeak(131);
150151
numdie++;
151152
done(2);
@@ -161,7 +162,7 @@ die(int entry)
161162
for (i = 100; i >= 1; i--) {
162163
if (!toting(i))
163164
continue;
164-
k = oldlc2;
165+
k = oldloc2;
165166
if (i == lamp)
166167
k = 1;
167168
drop(i, k);

games/adventure/extern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.h,v 1.11 2009/08/12 04:28:27 dholland Exp $ */
1+
/* $NetBSD: extern.h,v 1.12 2009/08/25 06:56:52 dholland Exp $ */
22

33
/*
44
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -89,7 +89,7 @@ void closing(void);
8989
void caveclose(void);
9090

9191
/* vocab.c */
92-
void dstroy(int);
92+
void destroy(int);
9393
void juggle(int);
9494
void move(int, int);
9595
int put(int, int, int);

games/adventure/hdr.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: hdr.h,v 1.12 2009/08/12 04:28:27 dholland Exp $ */
1+
/* $NetBSD: hdr.h,v 1.13 2009/08/25 06:56:52 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -65,11 +65,11 @@ extern char data_file[]; /* Virtual data file */
6565
#define FLUSHLINE do { int flushline_ch; while ((flushline_ch = getchar()) != EOF && flushline_ch != '\n'); } while (0)
6666
#define FLUSHLF while (next()!=LF)
6767

68-
extern int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
68+
extern int loc, newloc, oldloc, oldloc2, wasdark, gaveup, kq, k, k2;
6969
extern char *wd1, *wd2; /* the complete words */
7070
extern int verb, obj, spk;
7171
extern int blklin;
72-
extern int saveday, savet, mxscor, latncy;
72+
extern int saveday, savet, maxscore, latency;
7373

7474
#define SHORT 50 /* How short is a demo game? */
7575

@@ -87,70 +87,70 @@ struct text {
8787
int txtlen; /* length of msg starting here */
8888
};
8989

90-
#define RTXSIZ 205
91-
extern struct text rtext[RTXSIZ]; /* random text messages */
90+
#define RTXSIZE 205
91+
extern struct text rtext[RTXSIZE]; /* random text messages */
9292

93-
#define MAGSIZ 35
94-
extern struct text mtext[MAGSIZ]; /* magic messages */
93+
#define MAGSIZE 35
94+
extern struct text mtext[MAGSIZE]; /* magic messages */
9595

96-
extern int clsses;
96+
extern int classes;
9797
#define CLSMAX 12
9898
extern struct text ctext[CLSMAX]; /* classes of adventurer */
9999
extern int cval[CLSMAX];
100100

101101
extern struct text ptext[101]; /* object descriptions */
102102

103-
#define LOCSIZ 141 /* number of locations */
104-
extern struct text ltext[LOCSIZ]; /* long loc description */
105-
extern struct text stext[LOCSIZ]; /* short loc descriptions */
103+
#define LOCSIZE 141 /* number of locations */
104+
extern struct text ltext[LOCSIZE]; /* long loc description */
105+
extern struct text stext[LOCSIZE]; /* short loc descriptions */
106106

107107
extern struct travlist { /* direcs & conditions of travel */
108108
struct travlist *next; /* ptr to next list entry */
109109
int conditions; /* m in writeup (newloc / 1000) */
110110
int tloc; /* n in writeup (newloc % 1000) */
111111
int tverb; /* the verb that takes you there */
112-
} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */
112+
} *travel[LOCSIZE], *tkk; /* travel is closer to keys(...) */
113113

114-
extern int atloc[LOCSIZ];
114+
extern int atloc[LOCSIZE];
115115

116116
extern int plac[101]; /* initial object placement */
117117
extern int fixd[101], fixed[101]; /* location fixed? */
118118

119-
extern int actspk[35]; /* rtext msg for verb <n> */
119+
extern int actspeak[35]; /* rtext msg for verb <n> */
120120

121-
extern int cond[LOCSIZ]; /* various condition bits */
121+
extern int cond[LOCSIZE]; /* various condition bits */
122122

123123
extern int setbit[16]; /* bit defn masks 1,2,4,... */
124124

125-
extern int hntmax;
125+
extern int hintmax;
126126
extern int hints[20][5]; /* info on hints */
127127
extern int hinted[20], hintlc[20];
128128

129129
extern int place[101], prop[101], links[201];
130-
extern int abb[LOCSIZ];
130+
extern int abb[LOCSIZE];
131131

132132
extern int maxtrs, tally, tally2; /* treasure values */
133133

134134
#define FALSE 0
135135
#define TRUE 1
136136

137137
extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
138-
bird, door, pillow, snake, fissur, tablet, clam, oyster,
139-
magzin, dwarf, knife, food, bottle, water, oil, plant, plant2,
140-
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
141-
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
142-
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
143-
null, entrnc, dprssn, /*enter, stream, pour,*/ say, lock, throw,
144-
find, invent;
138+
bird, door, pillow, snake, fissure, tablet, clam, oyster,
139+
magazine, dwarf, knife, food, bottle, water, oil, plant, plant2,
140+
axe, mirror, dragon, chasm, troll, troll2, bear, message,
141+
vend, batter, nugget, coins, chest, eggs, trident, vase,
142+
emerald, pyramid, pearl, rug, chain, spices, back, look, cave,
143+
null, entrance, depression, /*enter, stream, pour,*/ say, lock,
144+
throw, find, invent;
145145

146146
extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
147-
odloc[7], dflag, daltlc;
147+
odloc[7], dflag, daltloc;
148148

149149
extern int tk[21], stick, dtotal, attack;
150150
extern int turns, lmwarn, iwest, knfloc, detail, /* various flags and
151151
* counters */
152-
abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1,
153-
clock2, saved, closng, panic, closed, scorng;
152+
abbnum, maxdie, numdie, holding, dkill, foobar, bonus, clock1,
153+
clock2, saved, isclosing, panic, closed, scoring;
154154

155155
extern int demo, limit;
156156

0 commit comments

Comments
 (0)