Continue with next room if the path for the arrow is found
[wumpus.git] / wumpus.c
index 5aef1c3a19608601b9d2f7062b48ffee81c5979c..f4dfe50fca6d90f60971f9e02c58fad8a001d066 100644 (file)
--- a/wumpus.c
+++ b/wumpus.c
  *
  * So, pretend for a little while that your workstation is an ASR-33 and
  * limber up your fingers for a trip to nostalgia-land...
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
  */
 
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/socket.h>
 
 /* 5 REM *** HUNT THE WUMPUS ***                                       */
 
@@ -123,8 +129,6 @@ char *prompt;
 
 void print_instructions()
 {
-    char ebuf[BUFSIZ];
-
 /* 375 REM *** INSTRUCTIONS ***                                                */
 /* 380 PRINT "WELCOME TO 'HUNT THE WUMPUS'"                            */
     puts("WELCOME TO 'HUNT THE WUMPUS'");
@@ -351,6 +355,7 @@ badrange:
                check_shot();
                if (finished != NOT)
                    return;
+               goto nextpath;
            }
 
            /* 820 NEXT K1                                              */
@@ -364,9 +369,9 @@ badrange:
        check_shot();
 
        /* 840 NEXT K                                                   */
+       nextpath: ;
     }
 
-ammo:
     if (finished == NOT)
     {
        /* 845 PRINT "MISSED"                                           */
@@ -521,7 +526,7 @@ goodmove:
     }
 }
 
-main(argc, argv)
+int main(argc, argv)
 int argc;
 char *argv[];
 {