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