-/* $NetBSD: room.c,v 1.4 1997/01/07 11:56:49 tls Exp $ */
+/* $NetBSD: room.c,v 1.5 1997/10/10 11:40:16 lukem Exp $ */
/*
* Copyright (c) 1983, 1993
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)room.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$NetBSD: room.c,v 1.4 1997/01/07 11:56:49 tls Exp $";
+__RCSID("$NetBSD: room.c,v 1.5 1997/10/10 11:40:16 lukem Exp $");
#endif
#endif /* not lint */
#include "extern.h"
+void
writedes()
{
int compass;
- register char *p;
- register c;
+ char *p;
+ int c;
printf("\n\t%s\n", location[position].name);
if (beenthere[position] < 3) {
compass = NORTH;
- for (p = location[position].desc; c = *p++;)
+ for (p = location[position].desc; (c = *p++) != 0;)
if (c != '-' && c != '*' && c != '+')
putchar(c);
else {
}
}
+void
printobjs()
{
- register unsigned int *p = location[position].objects;
- register n;
+ unsigned int *p = location[position].objects;
+ int n;
printf("\n");
for (n = 0; n < NUMOFOBJECTS; n++)
puts(objdes[n]);
}
+void
whichway(here)
-struct room here;
+ struct room here;
{
switch(direction) {
char *
truedirec(way, option)
-int way;
-char option;
+ int way;
+ char option;
{
switch(way) {
case NORTH:
return("ahead");
case SOUTH:
- return(option == '+' ? "behind you" : "back");
+ return(option == '+' ? "behind you" :
+ "back");
case EAST:
return("left");
case WEST:
case SOUTH:
switch(direction) {
case NORTH:
- return(option == '+' ? "behind you" : "back");
+ return(option == '+' ? "behind you" :
+ "back");
case SOUTH:
return("ahead");
case EAST:
case EAST:
return("ahead");
case WEST:
- return(option == '+' ? "behind you" : "back");
+ return(option == '+' ? "behind you" :
+ "back");
}
case WEST:
case SOUTH:
return("right");
case EAST:
- return(option == '+' ? "behind you" : "back");
+ return(option == '+' ? "behind you" :
+ "back");
case WEST:
return("ahead");
}
}
}
+void
newway(thisway)
-int thisway;
+ int thisway;
{
switch(direction){