diff options
author | jsm <jsm@NetBSD.org> | 2000-09-23 19:23:57 +0000 |
---|---|---|
committer | jsm <jsm@NetBSD.org> | 2000-09-23 19:23:57 +0000 |
commit | ed51e2ee8c47dbb4c8041637e215fab3dac5bc06 (patch) | |
tree | f0754b91491885c992dfec97463662771c64eb3e /battlestar/globals.c | |
parent | d89b56558a1f45934500212b523bd084ad39752c (diff) | |
download | bsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.tar.gz bsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.tar.zst bsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.zip |
Use a lookup table to identify whether objects are plural or singular,
instead of testing the final character against 's' in each place.
Avoids oddities about "pot of jewels" and "compass".
Diffstat (limited to 'battlestar/globals.c')
-rw-r--r-- | battlestar/globals.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/battlestar/globals.c b/battlestar/globals.c index 5805cf96..379cd70a 100644 --- a/battlestar/globals.c +++ b/battlestar/globals.c @@ -1,4 +1,4 @@ -/* $NetBSD: globals.c,v 1.13 2000/09/21 17:44:34 jsm Exp $ */ +/* $NetBSD: globals.c,v 1.14 2000/09/23 19:23:58 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: globals.c,v 1.13 2000/09/21 17:44:34 jsm Exp $"); +__RCSID("$NetBSD: globals.c,v 1.14 2000/09/23 19:23:58 jsm Exp $"); #endif #endif /* not lint */ @@ -220,6 +220,17 @@ const int objcumber[NUMOFOBJECTS] = { 10, 8, 8, 10, 10, 3, 1, 2 }; +const int objflags[NUMOFOBJECTS] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, OBJ_PLURAL, 0, OBJ_PLURAL, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, OBJ_PLURAL, 0, 0, 0, + 0, 0, 0, 0, OBJ_PLURAL, 0, 0, OBJ_PLURAL, + 0, 0, OBJ_PLURAL, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + int win = 1; int matchcount = 20; int followgod = -1; |