-/* $NetBSD: wump.c,v 1.25 2009/08/27 00:19:52 dholland Exp $ */
+/* $NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
#if 0
static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: wump.c,v 1.25 2009/08/27 00:19:52 dholland Exp $");
+__RCSID("$NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $");
#endif
#endif /* not lint */
static int wump_nearby(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int c, e=0;
}
if (room_num > MAX_ROOMS_IN_CAVE) {
(void)fprintf(stderr,
- "Even wumpii can't furnish caves that large!\n");
+ "Even wumpi can't furnish caves that large!\n");
exit(1);
}
break;
link_num = atoi(optarg);
if (link_num < 2) {
(void)fprintf(stderr,
- "Wumpii like extra doors in their caves!\n");
+ "Wumpi like extra doors in their caves!\n");
exit(1);
}
break;
}
static void
-display_room_stats()
+display_room_stats(void)
{
int i;
/*
* Routine will explain what's going on with the current room, as well
- * as describe whether there are pits, bats, & wumpii nearby. It's
+ * as describe whether there are pits, bats, & wumpi nearby. It's
* all pretty mindless, really.
*/
(void)printf(
}
static int
-take_action()
+take_action(void)
{
/*
* Do the action specified by the player, either 'm'ove, 's'hoot
}
static int
-move_to(room_number)
- const char *room_number;
+move_to(const char *room_number)
{
int i, just_moved_by_bats, next_room, tunnel_available;
}
static int
-shoot(room_list)
- char *room_list;
+shoot(char *room_list)
{
int chance, next, roomcnt;
int j, arrow_location, lnk, ok;
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]);
}
static int
-gcd(a, b)
- int a, b;
+gcd(int a, int b)
{
int r;
}
static void
-cave_init()
+cave_init(void)
{
int i, j, k, lnk;
int delta;
}
static void
-clear_things_in_cave()
+clear_things_in_cave(void)
{
int i;
}
static void
-initialize_things_in_cave()
+initialize_things_in_cave(void)
{
int i, loc;
}
static int
-getans(prompt)
- const char *prompt;
+getans(const char *prompt)
{
char buf[20];
}
static int
-bats_nearby()
+bats_nearby(void)
{
int i;
}
static int
-pit_nearby()
+pit_nearby(void)
{
int i;
}
static int
-wump_nearby()
+wump_nearby(void)
{
int i, j;
}
static void
-move_wump()
+move_wump(void)
{
wumpus_loc = cave[wumpus_loc].tunnel[random() % link_num];
}
static int
-int_compare(a, b)
- const void *a, *b;
+int_compare(const void *a, const void *b)
{
return(*(const int *)a < *(const int *)b ? -1 : 1);
}
static void
-instructions()
+instructions(void)
{
const char *pager;
pid_t pid;
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n");
/* messages */
static void
-wump_kill()
+wump_kill(void)
{
(void)printf(
"*ROAR* *chomp* *snurfle* *chomp*!\n\
}
static void
-kill_wump()
+kill_wump(void)
{
(void)printf(
"*thwock!* *groan* *crash*\n\n\
}
static void
-no_arrows()
+no_arrows(void)
{
(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");
}
static void
-shoot_self()
+shoot_self(void)
{
(void)printf(
"\n*Thwack!* A sudden piercing feeling informs you that the ricochet\n\
}
static void
-jump(where)
- int where;
+jump(int where)
{
(void)printf(
"\nWith a jaunty step you enter the magic tunnel. As you do, you\n\
}
static void
-pit_kill()
+pit_kill(void)
{
(void)printf(
"*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\
}
static void
-pit_survive()
+pit_survive(void)
{
(void)printf(
"Without conscious thought you grab for the side of the cave and manage\n\