1 /* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 char copyright[] = 10 "@(#) Copyright (c) 1983 Regents of the University of California.\n\ 11 All rights reserved.\n"; 12 #endif /* not lint */ 13 14 #ifndef lint 15 static char sccsid[] = "@(#)battlestar.c 5.3 (Berkeley) 06/01/90"; 16 #endif /* not lint */ 17 18 /* 19 * Battlestar - a stellar-tropical adventure game 20 * 21 * Originally written by His Lordship, Admiral David W. Horatio Riggle, 22 * on the Cory PDP-11/70, University of California, Berkeley. 23 */ 24 25 #include "externs.h" 26 27 main(argc,argv) 28 int argc; 29 char **argv; 30 { 31 char mainbuf[LINELENGTH]; 32 char *next; 33 34 initialize(argc < 2 || strcmp(argv[1], "-r")); 35 start: 36 news(); 37 beenthere[position]++; 38 if (notes[LAUNCHED]) 39 crash(); /* decrements fuel & crash */ 40 if (matchlight) { 41 puts("Your match splutters out."); 42 matchlight = 0; 43 } 44 if (!notes[CANTSEE] || testbit(inven,LAMPON) || 45 testbit(location[position].objects, LAMPON)) { 46 writedes(); 47 printobjs(); 48 } else 49 puts("It's too dark to see anything in here!"); 50 whichway(location[position]); 51 run: 52 next = getcom(mainbuf, sizeof mainbuf, ">-: ", 53 "Please type in something."); 54 for (wordcount = 0; next && wordcount < 20; wordcount++) 55 next = getword(next, words[wordcount], -1); 56 parse(); 57 switch (cypher()) { 58 case -1: 59 goto run; 60 case 0: 61 goto start; 62 default: 63 exit(); 64 } 65 } 66