Commit | Line | Data |
---|---|---|
bcb229fe | 1 | /* |
b8c620d6 | 2 | * Copyright (c) 1983 Regents of the University of California. |
bcb229fe KB |
3 | * All rights reserved. |
4 | * | |
7c5ab767 | 5 | * %sccs.include.redist.c% |
bcb229fe KB |
6 | */ |
7 | ||
8 | #ifndef lint | |
9 | char copyright[] = | |
b8c620d6 | 10 | "@(#) Copyright (c) 1983 Regents of the University of California.\n\ |
bcb229fe KB |
11 | All rights reserved.\n"; |
12 | #endif /* not lint */ | |
13 | ||
14 | #ifndef lint | |
6538ddf3 | 15 | static char sccsid[] = "@(#)main.c 5.4 (Berkeley) %G%"; |
bcb229fe KB |
16 | #endif /* not lint */ |
17 | ||
18 | # include "hangman.h" | |
19 | ||
20 | /* | |
21 | * This game written by Ken Arnold. | |
22 | */ | |
23 | main() | |
24 | { | |
6538ddf3 KB |
25 | void die(); |
26 | ||
bcb229fe KB |
27 | initscr(); |
28 | signal(SIGINT, die); | |
29 | setup(); | |
30 | for (;;) { | |
31 | Wordnum++; | |
32 | playgame(); | |
33 | Average = (Average * (Wordnum - 1) + Errors) / Wordnum; | |
34 | } | |
35 | /* NOTREACHED */ | |
36 | } | |
37 | ||
38 | /* | |
39 | * die: | |
40 | * Die properly. | |
41 | */ | |
6538ddf3 | 42 | void |
bcb229fe KB |
43 | die() |
44 | { | |
45 | mvcur(0, COLS - 1, LINES - 1, 0); | |
46 | endwin(); | |
47 | putchar('\n'); | |
48 | exit(0); | |
49 | } |