"abbreviation" has two Bs.diff -r1.15 -r1.16 src/games/trek/getpar.c
(dholland)
--- src/games/trek/getpar.c 2009/05/24 23:20:22 1.15
+++ src/games/trek/getpar.c 2009/05/25 00:39:45 1.16
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: getpar.c,v 1.15 2009/05/24 23:20:22 dholland Exp $ */ | 1 | /* $NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1993 | 4 | * Copyright (c) 1980, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; | 35 | static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: getpar.c,v 1.15 2009/05/24 23:20:22 dholland Exp $"); | 37 | __RCSID("$NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <stdio.h> | 41 | #include <stdio.h> | |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> | |
43 | #include <string.h> | 43 | #include <string.h> | |
44 | #include "getpar.h" | 44 | #include "getpar.h" | |
45 | #include "trek.h" | 45 | #include "trek.h" | |
46 | 46 | |||
47 | static int testterm(void); | 47 | static int testterm(void); | |
48 | 48 | |||
49 | /** | 49 | /** | |
50 | ** get integer parameter | 50 | ** get integer parameter | |
@@ -135,57 +135,57 @@ getcodpar(const char *s, const struct cv | @@ -135,57 +135,57 @@ getcodpar(const char *s, const struct cv | |||
135 | /* throw out the newline */ | 135 | /* throw out the newline */ | |
136 | getchar(); | 136 | getchar(); | |
137 | } | 137 | } | |
138 | scanf("%*[ \t;]"); | 138 | scanf("%*[ \t;]"); | |
139 | if ((c = scanf("%99[^ \t;\n]", input)) < 0) | 139 | if ((c = scanf("%99[^ \t;\n]", input)) < 0) | |
140 | exit(1); | 140 | exit(1); | |
141 | if (c == 0) | 141 | if (c == 0) | |
142 | continue; | 142 | continue; | |
143 | flag = 1; | 143 | flag = 1; | |
144 | 144 | |||
145 | /* if command list, print four per line */ | 145 | /* if command list, print four per line */ | |
146 | if (input[0] == '?' && input[1] == 0) { | 146 | if (input[0] == '?' && input[1] == 0) { | |
147 | c = 4; | 147 | c = 4; | |
148 | for (r = tab; r->abrev; r++) { | 148 | for (r = tab; r->abbrev; r++) { | |
149 | strcpy(input, r->abrev); | 149 | strcpy(input, r->abbrev); | |
150 | strcat(input, r->full); | 150 | strcat(input, r->full); | |
151 | printf("%14.14s", input); | 151 | printf("%14.14s", input); | |
152 | if (--c > 0) | 152 | if (--c > 0) | |
153 | continue; | 153 | continue; | |
154 | c = 4; | 154 | c = 4; | |
155 | printf("\n"); | 155 | printf("\n"); | |
156 | } | 156 | } | |
157 | if (c != 4) | 157 | if (c != 4) | |
158 | printf("\n"); | 158 | printf("\n"); | |
159 | continue; | 159 | continue; | |
160 | } | 160 | } | |
161 | 161 | |||
162 | /* search for in table */ | 162 | /* search for in table */ | |
163 | for (r = tab; r->abrev; r++) { | 163 | for (r = tab; r->abbrev; r++) { | |
164 | p = input; | 164 | p = input; | |
165 | for (q = r->abrev; *q; q++) | 165 | for (q = r->abbrev; *q; q++) | |
166 | if (*p++ != *q) | 166 | if (*p++ != *q) | |
167 | break; | 167 | break; | |
168 | if (!*q) { | 168 | if (!*q) { | |
169 | for (q = r->full; *p && *q; q++, p++) | 169 | for (q = r->full; *p && *q; q++, p++) | |
170 | if (*p != *q) | 170 | if (*p != *q) | |
171 | break; | 171 | break; | |
172 | if (!*p || !*q) | 172 | if (!*p || !*q) | |
173 | break; | 173 | break; | |
174 | } | 174 | } | |
175 | } | 175 | } | |
176 | 176 | |||
177 | /* check for not found */ | 177 | /* check for not found */ | |
178 | if (!r->abrev) { | 178 | if (!r->abbrev) { | |
179 | printf("invalid input; ? for valid inputs\n"); | 179 | printf("invalid input; ? for valid inputs\n"); | |
180 | skiptonl(0); | 180 | skiptonl(0); | |
181 | } else | 181 | } else | |
182 | return (r); | 182 | return (r); | |
183 | } | 183 | } | |
184 | } | 184 | } | |
185 | 185 | |||
186 | 186 | |||
187 | /** | 187 | /** | |
188 | ** get string parameter | 188 | ** get string parameter | |
189 | **/ | 189 | **/ | |
190 | 190 | |||
191 | void | 191 | void |
--- src/games/trek/getpar.h 2009/05/24 21:44:56 1.11
+++ src/games/trek/getpar.h 2009/05/25 00:39:45 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: getpar.h,v 1.11 2009/05/24 21:44:56 dholland Exp $ */ | 1 | /* $NetBSD: getpar.h,v 1.12 2009/05/25 00:39:45 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1993 | 4 | * Copyright (c) 1980, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -25,27 +25,27 @@ | @@ -25,27 +25,27 @@ | |||
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | * | 30 | * | |
31 | * @(#)getpar.h 8.1 (Berkeley) 5/31/93 | 31 | * @(#)getpar.h 8.1 (Berkeley) 5/31/93 | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | typedef void (*cmdfun)(int); | 34 | typedef void (*cmdfun)(int); | |
35 | 35 | |||
36 | /* used for getcodpar() parameter list */ | 36 | /* used for getcodpar() parameter list */ | |
37 | struct cvntab { | 37 | struct cvntab { | |
38 | const char *abrev; | 38 | const char *abbrev; | |
39 | const char *full; | 39 | const char *full; | |
40 | cmdfun value; | 40 | cmdfun value; | |
41 | int value2; | 41 | int value2; | |
42 | }; | 42 | }; | |
43 | 43 | |||
44 | extern const struct cvntab Skitab[]; | 44 | extern const struct cvntab Skitab[]; | |
45 | extern const struct cvntab Lentab[]; | 45 | extern const struct cvntab Lentab[]; | |
46 | 46 | |||
47 | int getintpar(const char *); | 47 | int getintpar(const char *); | |
48 | double getfltpar(const char *); | 48 | double getfltpar(const char *); | |
49 | int getynpar(const char *); | 49 | int getynpar(const char *); | |
50 | const struct cvntab *getcodpar(const char *, const struct cvntab[]); | 50 | const struct cvntab *getcodpar(const char *, const struct cvntab[]); | |
51 | void getstrpar(const char *, char *, int, const char *); | 51 | void getstrpar(const char *, char *, int, const char *); |
--- src/games/trek/win.c 2009/05/24 23:00:46 1.11
+++ src/games/trek/win.c 2009/05/25 00:39:45 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: win.c,v 1.11 2009/05/24 23:00:46 dholland Exp $ */ | 1 | /* $NetBSD: win.c,v 1.12 2009/05/25 00:39:45 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1993 | 4 | * Copyright (c) 1980, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)win.c 8.1 (Berkeley) 5/31/93"; | 35 | static char sccsid[] = "@(#)win.c 8.1 (Berkeley) 5/31/93"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: win.c,v 1.11 2009/05/24 23:00:46 dholland Exp $"); | 37 | __RCSID("$NetBSD: win.c,v 1.12 2009/05/25 00:39:45 dholland Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <stdio.h> | 41 | #include <stdio.h> | |
42 | #include <unistd.h> | 42 | #include <unistd.h> | |
43 | #include <setjmp.h> | 43 | #include <setjmp.h> | |
44 | #include "trek.h" | 44 | #include "trek.h" | |
45 | #include "getpar.h" | 45 | #include "getpar.h" | |
46 | 46 | |||
47 | /* | 47 | /* | |
48 | ** Signal game won | 48 | ** Signal game won | |
49 | ** | 49 | ** | |
50 | ** This routine prints out the win message, arranges to print out | 50 | ** This routine prints out the win message, arranges to print out | |
@@ -71,23 +71,23 @@ win(void) | @@ -71,23 +71,23 @@ win(void) | |||
71 | 71 | |||
72 | /* print and return the score */ | 72 | /* print and return the score */ | |
73 | s = score(); | 73 | s = score(); | |
74 | 74 | |||
75 | /* decide if she gets a promotion */ | 75 | /* decide if she gets a promotion */ | |
76 | if (Game.helps == 0 && Game.killb == 0 && Game.killinhab == 0 && | 76 | if (Game.helps == 0 && Game.killb == 0 && Game.killinhab == 0 && | |
77 | 5 * Game.kills + Game.deaths < 100 && | 77 | 5 * Game.kills + Game.deaths < 100 && | |
78 | s >= 1000 && Ship.ship == ENTERPRISE) { | 78 | s >= 1000 && Ship.ship == ENTERPRISE) { | |
79 | printf("In fact, you are promoted one step in rank,\n"); | 79 | printf("In fact, you are promoted one step in rank,\n"); | |
80 | if (Game.skill >= 6) { | 80 | if (Game.skill >= 6) { | |
81 | printf("to the exalted rank of Commodore Emeritus\n"); | 81 | printf("to the exalted rank of Commodore Emeritus\n"); | |
82 | } else { | 82 | } else { | |
83 | p = &Skitab[Game.skill - 1]; | 83 | p = &Skitab[Game.skill - 1]; | |
84 | printf("from %s%s ", p->abrev, p->full); | 84 | printf("from %s%s ", p->abbrev, p->full); | |
85 | p++; | 85 | p++; | |
86 | printf("to %s%s\n", p->abrev, p->full); | 86 | printf("to %s%s\n", p->abbrev, p->full); | |
87 | } | 87 | } | |
88 | } | 88 | } | |
89 | 89 | |||
90 | /* clean out input, and request new game */ | 90 | /* clean out input, and request new game */ | |
91 | skiptonl(0); | 91 | skiptonl(0); | |
92 | longjmp(env, 1); | 92 | longjmp(env, 1); | |
93 | } | 93 | } |
--- src/games/trek/score.c 2009/05/25 00:03:18 1.10
+++ src/games/trek/score.c 2009/05/25 00:39:45 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: score.c,v 1.10 2009/05/25 00:03:18 dholland Exp $ */ | 1 | /* $NetBSD: score.c,v 1.11 2009/05/25 00:39:45 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1993 | 4 | * Copyright (c) 1980, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; | 35 | static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: score.c,v 1.10 2009/05/25 00:03:18 dholland Exp $"); | 37 | __RCSID("$NetBSD: score.c,v 1.11 2009/05/25 00:39:45 dholland Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <stdarg.h> | 41 | #include <stdarg.h> | |
42 | #include <stdio.h> | 42 | #include <stdio.h> | |
43 | #include "trek.h" | 43 | #include "trek.h" | |
44 | #include "getpar.h" | 44 | #include "getpar.h" | |
45 | 45 | |||
46 | /* | 46 | /* | |
47 | ** PRINT OUT THE CURRENT SCORE | 47 | ** PRINT OUT THE CURRENT SCORE | |
48 | */ | 48 | */ | |
49 | 49 | |||
50 | static void scoreitem(long amount, const char *descfmt, ...) | 50 | static void scoreitem(long amount, const char *descfmt, ...) | |
@@ -84,27 +84,27 @@ score(void) | @@ -84,27 +84,27 @@ score(void) | |||
84 | r = 1.0; | 84 | r = 1.0; | |
85 | r = Game.killk / r; | 85 | r = Game.killk / r; | |
86 | s += (t = 400 * r); | 86 | s += (t = 400 * r); | |
87 | scoreitem(t, "Kill rate %.2f Klingons/stardate", r); | 87 | scoreitem(t, "Kill rate %.2f Klingons/stardate", r); | |
88 | 88 | |||
89 | r = Now.klings; | 89 | r = Now.klings; | |
90 | r /= Game.killk + 1; | 90 | r /= Game.killk + 1; | |
91 | s += (t = -400 * r); | 91 | s += (t = -400 * r); | |
92 | scoreitem(t, "Penalty for %d klingons remaining", Now.klings); | 92 | scoreitem(t, "Penalty for %d klingons remaining", Now.klings); | |
93 | 93 | |||
94 | if (Move.endgame > 0) { | 94 | if (Move.endgame > 0) { | |
95 | s += (t = 100 * (u = Game.skill)); | 95 | s += (t = 100 * (u = Game.skill)); | |
96 | scoreitem(t, "Bonus for winning a %s%s game", | 96 | scoreitem(t, "Bonus for winning a %s%s game", | |
97 | Skitab[u - 1].abrev, Skitab[u - 1].full); | 97 | Skitab[u - 1].abbrev, Skitab[u - 1].full); | |
98 | } | 98 | } | |
99 | 99 | |||
100 | if (Game.killed) { | 100 | if (Game.killed) { | |
101 | s -= 500; | 101 | s -= 500; | |
102 | scoreitem(-500, "Penalty for getting killed"); | 102 | scoreitem(-500, "Penalty for getting killed"); | |
103 | } | 103 | } | |
104 | 104 | |||
105 | s += (t = -100 * (u = Game.killb)); | 105 | s += (t = -100 * (u = Game.killb)); | |
106 | scoreitem(t, "%d starbases killed", u); | 106 | scoreitem(t, "%d starbases killed", u); | |
107 | 107 | |||
108 | s += (t = -100 * (u = Game.helps)); | 108 | s += (t = -100 * (u = Game.helps)); | |
109 | scoreitem(t, "%d calls for help", u); | 109 | scoreitem(t, "%d calls for help", u); | |
110 | 110 |
--- src/games/trek/srscan.c 2009/05/24 22:55:03 1.9
+++ src/games/trek/srscan.c 2009/05/25 00:39:45 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: srscan.c,v 1.9 2009/05/24 22:55:03 dholland Exp $ */ | 1 | /* $NetBSD: srscan.c,v 1.10 2009/05/25 00:39:45 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1993 | 4 | * Copyright (c) 1980, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)srscan.c 8.1 (Berkeley) 5/31/93"; | 35 | static char sccsid[] = "@(#)srscan.c 8.1 (Berkeley) 5/31/93"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: srscan.c,v 1.9 2009/05/24 22:55:03 dholland Exp $"); | 37 | __RCSID("$NetBSD: srscan.c,v 1.10 2009/05/25 00:39:45 dholland Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <stdio.h> | 41 | #include <stdio.h> | |
42 | #include "trek.h" | 42 | #include "trek.h" | |
43 | #include "getpar.h" | 43 | #include "getpar.h" | |
44 | 44 | |||
45 | /* | 45 | /* | |
46 | ** SHORT RANGE SENSOR SCAN | 46 | ** SHORT RANGE SENSOR SCAN | |
47 | ** | 47 | ** | |
48 | ** A short range scan is taken of the current quadrant. If the | 48 | ** A short range scan is taken of the current quadrant. If the | |
49 | ** flag 'f' is one, it is an "auto srscan", which is not done | 49 | ** flag 'f' is one, it is an "auto srscan", which is not done | |
50 | ** unless in 'fast' mode. It does a status report and a srscan. | 50 | ** unless in 'fast' mode. It does a status report and a srscan. | |
@@ -156,28 +156,28 @@ srscan(int f) | @@ -156,28 +156,28 @@ srscan(int f) | |||
156 | } | 156 | } | |
157 | printf("active"); | 157 | printf("active"); | |
158 | break; | 158 | break; | |
159 | } | 159 | } | |
160 | printf("\n"); | 160 | printf("\n"); | |
161 | } | 161 | } | |
162 | if (f < 0) { | 162 | if (f < 0) { | |
163 | printf("current crew %d\n", Ship.crew); | 163 | printf("current crew %d\n", Ship.crew); | |
164 | printf("brig space %d\n", Ship.brigfree); | 164 | printf("brig space %d\n", Ship.brigfree); | |
165 | printf("Klingon power %d\n", Param.klingpwr); | 165 | printf("Klingon power %d\n", Param.klingpwr); | |
166 | p = &Lentab[Game.length - 1]; | 166 | p = &Lentab[Game.length - 1]; | |
167 | if (Game.length > 2) | 167 | if (Game.length > 2) | |
168 | p--; | 168 | p--; | |
169 | printf("Length, Skill %s%s, ", p->abrev, p->full); | 169 | printf("Length, Skill %s%s, ", p->abbrev, p->full); | |
170 | p = &Skitab[Game.skill - 1]; | 170 | p = &Skitab[Game.skill - 1]; | |
171 | printf("%s%s\n", p->abrev, p->full); | 171 | printf("%s%s\n", p->abbrev, p->full); | |
172 | return; | 172 | return; | |
173 | } | 173 | } | |
174 | printf(" "); | 174 | printf(" "); | |
175 | for (i = 0; i < NSECTS; i++) | 175 | for (i = 0; i < NSECTS; i++) | |
176 | printf("%d ", i); | 176 | printf("%d ", i); | |
177 | printf("\n"); | 177 | printf("\n"); | |
178 | 178 | |||
179 | if (q->qsystemname & Q_DISTRESSED) | 179 | if (q->qsystemname & Q_DISTRESSED) | |
180 | printf("Distressed "); | 180 | printf("Distressed "); | |
181 | if (q->qsystemname) | 181 | if (q->qsystemname) | |
182 | printf("Starsystem %s\n", systemname(q)); | 182 | printf("Starsystem %s\n", systemname(q)); | |
183 | } | 183 | } |