xref: /original-bsd/games/hangman/playgame.c (revision 47436896)
1 /*-
2  * Copyright (c) 1983 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)playgame.c	5.3 (Berkeley) 04/08/91";
10 #endif /* not lint */
11 
12 # include	"hangman.h"
13 
14 /*
15  * playgame:
16  *	play a game
17  */
18 playgame()
19 {
20 	register bool	*bp;
21 
22 	getword();
23 	Errors = 0;
24 	bp = Guessed;
25 	while (bp < &Guessed[26])
26 		*bp++ = FALSE;
27 	while (Errors < MAXERRS && index(Known, '-') != NULL) {
28 		prword();
29 		prdata();
30 		prman();
31 		getguess();
32 	}
33 	endgame();
34 }
35