date and time created 87/12/22 13:08:08 by bostic
[unix-history] / usr / src / games / hangman / main.c
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef lint
char copyright[] =
"@(#) Copyright (c) 1987 Regents of the University of California.\n\
All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char sccsid[] = "@(#)main.c 5.1 (Berkeley) %G%";
#endif /* not lint */
# include "hangman.h"
/*
* This game written by Ken Arnold.
*/
main()
{
initscr();
signal(SIGINT, die);
setup();
for (;;) {
Wordnum++;
playgame();
Average = (Average * (Wordnum - 1) + Errors) / Wordnum;
}
/* NOTREACHED */
}
/*
* die:
* Die properly.
*/
die()
{
mvcur(0, COLS - 1, LINES - 1, 0);
endwin();
putchar('\n');
exit(0);
}