CVS commit: src/games/wump

2010-05-29 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat May 29 22:56:01 UTC 2010

Modified Files:
src/games/wump: wump.c

Log Message:
Fix some additional typos/grammar slips.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/games/wump/wump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/wump/wump.c
diff -u src/games/wump/wump.c:1.26 src/games/wump/wump.c:1.27
--- src/games/wump/wump.c:1.26	Sat May 29 22:53:49 2010
+++ src/games/wump/wump.c	Sat May 29 22:56:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wump.c,v 1.26 2010/05/29 22:53:49 dholland Exp $	*/
+/*	$NetBSD: wump.c,v 1.27 2010/05/29 22:56:01 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = @(#)wump.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: wump.c,v 1.26 2010/05/29 22:53:49 dholland Exp $);
+__RCSID($NetBSD: wump.c,v 1.27 2010/05/29 22:56:01 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -454,17 +454,17 @@
 			lnk = (random() % link_num);
 			if (lnk == player_loc)
 (void)printf(
-*thunk*  The arrow can't find a way from %d to %d and flys back into\n\
+*thunk*  The arrow can't find a way from %d to %d and flies back into\n\
 your room!\n,
 arrow_location, next);
 			else if (cave[arrow_location].tunnel[lnk]  room_num)
 (void)printf(
-*thunk*  The arrow flys randomly into a magic tunnel, thence into\n\
+*thunk*  The arrow flies randomly into a magic tunnel, thence into\n\
 room %d!\n,
 cave[arrow_location].tunnel[lnk]);
 			else
 (void)printf(
-*thunk*  The arrow can't find a way from %d to %d and flys randomly\n\
+*thunk*  The arrow can't find a way from %d to %d and flies randomly\n\
 into room %d!\n,
 arrow_location, next,
 cave[arrow_location].tunnel[lnk]);
@@ -831,7 +831,7 @@
 	(void)printf(
 \nYou turn and look at your quiver, and realize with a sinking feeling\n\
 that you've just shot your last arrow (figuratively, too).  Sensing this\n\
-with its psychic powers, the evil Wumpus rampagees through the cave, finds\n\
+with its psychic powers, the evil Wumpus rampages through the cave, finds\n\
 you, and with a mighty *ROAR* eats you alive!\n);
 }
 



CVS commit: src/games/wump

2009-08-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Aug 27 00:19:52 UTC 2009

Modified Files:
src/games/wump: wump.c

Log Message:
remove unnecessary cast


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/games/wump/wump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/wump/wump.c
diff -u src/games/wump/wump.c:1.24 src/games/wump/wump.c:1.25
--- src/games/wump/wump.c:1.24	Wed Aug 12 09:00:10 2009
+++ src/games/wump/wump.c	Thu Aug 27 00:19:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: wump.c,v 1.24 2009/08/12 09:00:10 dholland Exp $	*/
+/*	$NetBSD: wump.c,v 1.25 2009/08/27 00:19:52 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = @(#)wump.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: wump.c,v 1.24 2009/08/12 09:00:10 dholland Exp $);
+__RCSID($NetBSD: wump.c,v 1.25 2009/08/27 00:19:52 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -596,7 +596,7 @@
 	 * make it easier on the intrepid adventurer.
 	 */
 	for (i = 1; i = room_num; ++i)
-		qsort(cave[i].tunnel, (u_int)link_num,
+		qsort(cave[i].tunnel, link_num,
 		sizeof(cave[i].tunnel[0]), int_compare);
 
 #ifdef DEBUG



CVS commit: src/games/wump

2009-08-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Aug 12 09:00:10 UTC 2009

Modified Files:
src/games/wump: wump.c

Log Message:
sprinkle static


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/games/wump/wump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/wump/wump.c
diff -u src/games/wump/wump.c:1.23 src/games/wump/wump.c:1.24
--- src/games/wump/wump.c:1.23	Sun Jul 20 01:03:22 2008
+++ src/games/wump/wump.c	Wed Aug 12 09:00:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: wump.c,v 1.23 2008/07/20 01:03:22 lukem Exp $	*/
+/*	$NetBSD: wump.c,v 1.24 2009/08/12 09:00:10 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = @(#)wump.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: wump.c,v 1.23 2008/07/20 01:03:22 lukem Exp $);
+__RCSID($NetBSD: wump.c,v 1.24 2009/08/12 09:00:10 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -86,7 +86,7 @@
 #define	plural(n)	(n == 1 ?  : s)
 
 /* simple cave data structure; +1 so we can index from '1' not '0' */
-struct room_record {
+static struct room_record {
 	int tunnel[MAX_LINKS_IN_ROOM];
 	int has_a_pit, has_a_bat;
 } cave[MAX_ROOMS_IN_CAVE+1];
@@ -95,47 +95,47 @@
  * global variables so we can keep track of where the player is, how
  * many arrows they still have, where el wumpo is, and so on...
  */
-int player_loc = -1;			/* player location */
-int wumpus_loc = -1;			/* The Bad Guy location */
-int level = EASY;			/* level of play */
-int arrows_left;			/* arrows unshot */
+static int player_loc = -1;		/* player location */
+static int wumpus_loc = -1;		/* The Bad Guy location */
+static int level = EASY;		/* level of play */
+static int arrows_left;			/* arrows unshot */
 
 #ifdef DEBUG
-int debug = 0;
+static int debug = 0;
 #endif
 
-int pit_num = PIT_COUNT;		/* # pits in cave */
-int bat_num = BAT_COUNT;		/* # bats */
-int room_num = ROOMS_IN_CAVE;		/* # rooms in cave */
-int link_num = LINKS_IN_ROOM;		/* links per room  */
-int arrow_num = NUMBER_OF_ARROWS;	/* arrow inventory */
-
-char answer[20];			/* user input */
-
-int	bats_nearby(void);
-void	cave_init(void);
-void	clear_things_in_cave(void);
-void	display_room_stats(void);
-int	gcd(int, int);
-int	getans(const char *);
-void	initialize_things_in_cave(void);
-void	instructions(void);
-int	int_compare(const void *, const void *);
-void	jump(int);
-void	kill_wump(void);
+static int pit_num = PIT_COUNT;		/* # pits in cave */
+static int bat_num = BAT_COUNT;		/* # bats */
+static int room_num = ROOMS_IN_CAVE;	/* # rooms in cave */
+static int link_num = LINKS_IN_ROOM;	/* links per room  */
+static int arrow_num = NUMBER_OF_ARROWS;/* arrow inventory */
+
+static char answer[20];			/* user input */
+
 int	main(int, char **);
-int	move_to(const char *);
-void	move_wump(void);
-void	no_arrows(void);
-void	pit_kill(void);
-int	pit_nearby(void);
-void	pit_survive(void);
-int	shoot(char *);
-void	shoot_self(void);
-int	take_action(void);
-void	usage(void) __dead;
-void	wump_kill(void);
-int	wump_nearby(void);
+static int bats_nearby(void);
+static void cave_init(void);
+static void clear_things_in_cave(void);
+static void display_room_stats(void);
+static int gcd(int, int);
+static int getans(const char *);
+static void initialize_things_in_cave(void);
+static void instructions(void);
+static int int_compare(const void *, const void *);
+static void jump(int);
+static void kill_wump(void);
+static int move_to(const char *);
+static void move_wump(void);
+static void no_arrows(void);
+static void pit_kill(void);
+static int pit_nearby(void);
+static void pit_survive(void);
+static int shoot(char *);
+static void shoot_self(void);
+static int take_action(void);
+static void usage(void) __dead;
+static void wump_kill(void);
+static int wump_nearby(void);
 
 int
 main(argc, argv)
@@ -254,7 +254,7 @@
 	return (0);
 }
 
-void
+static void
 display_room_stats()
 {
 	int i;
@@ -284,7 +284,7 @@
 	(void)printf(and %d.\n, cave[player_loc].tunnel[link_num - 1]);
 }
 
-int
+static int
 take_action()
 {
 	/*
@@ -313,7 +313,7 @@
 	return(0);
 }
 
-int
+static int
 move_to(room_number)
 	const char *room_number;
 {
@@ -405,7 +405,7 @@
 	return(0);
 }
 
-int
+static int
 shoot(room_list)
 	char *room_list;
 {
@@ -518,7 +518,7 @@
 	return(0);
 }
 
-int
+static int
 gcd(a, b)
 	int a, b;
 {
@@ -530,7 +530,7 @@
 	return (gcd(b, r));
 }
 
-void
+static void
 cave_init()
 {
 	int i, j, k, lnk;
@@ -610,7 +610,7 @@
 #endif
 }
 
-void
+static void
 clear_things_in_cave()
 {
 	int i;
@@ -623,7 +623,7 @@
 		cave[i].has_a_bat = cave[i].has_a_pit = 0;
 }
 
-void
+static void
 initialize_things_in_cave()
 {
 	int i, loc;
@@ -667,7 +667,7 @@
 	(i  100  player_loc != wumpus_loc));
 }
 
-int
+static int
 getans(prompt)
 	const char *prompt;
 {
@@ -693,7 +693,7 @@
 	/* NOTREACHED */
 }
 
-int
+static int
 bats_nearby()
 { 
 	int i;
@@ -705,7 +705,7 @@