xref: /original-bsd/games/rogue/main.c (revision 95dec232)
1 /*
2  * Copyright (c) 1988, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Timothy C. Stoehr.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #ifndef lint
12 static char copyright[] =
13 "@(#) Copyright (c) 1988, 1993\n\
14 	The Regents of the University of California.  All rights reserved.\n";
15 #endif /* not lint */
16 
17 #ifndef lint
18 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 05/31/93";
19 #endif /* not lint */
20 
21 /*
22  * main.c
23  *
24  * This source herein may be modified and/or distributed by anybody who
25  * so desires, with the following restrictions:
26  *    1.)  No portion of this notice shall be removed.
27  *    2.)  Credit shall not be taken for the creation of this source.
28  *    3.)  This code is not to be traded, sold, or used for personal
29  *         gain or profit.
30  *
31  */
32 
33 #include "rogue.h"
34 
35 extern short party_room;
36 
37 main(argc, argv)
38 int argc;
39 char *argv[];
40 {
41 	if (init(argc, argv)) {		/* restored game */
42 		goto PL;
43 	}
44 
45 	for (;;) {
46 		clear_level();
47 		make_level();
48 		put_objects();
49 		put_stairs();
50 		add_traps();
51 		put_mons();
52 		put_player(party_room);
53 		print_stats(STAT_ALL);
54 PL:
55 		play_level();
56 		free_stuff(&level_objects);
57 		free_stuff(&level_monsters);
58 	}
59 }
60