1 /* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char copyright[] = 10 "@(#) Copyright (c) 1983, 1993\n\ 11 The Regents of the University of California. All rights reserved.\n"; 12 #endif /* not lint */ 13 14 #ifndef lint 15 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 05/31/93"; 16 #endif /* not lint */ 17 18 # include "hangman.h" 19 20 /* 21 * This game written by Ken Arnold. 22 */ 23 main() 24 { 25 void die(); 26 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 */ 42 void 43 die() 44 { 45 mvcur(0, COLS - 1, LINES - 1, 0); 46 endwin(); 47 putchar('\n'); 48 exit(0); 49 } 50