xref: /original-bsd/games/hangman/prdata.c (revision b4971bb3)
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 sccsid[] = "@(#)prdata.c	8.1 (Berkeley) 05/31/93";
10 #endif /* not lint */
11 
12 # include	"hangman.h"
13 
14 /*
15  * prdata:
16  *	Print out the current guesses
17  */
18 prdata()
19 {
20 	register bool	*bp;
21 
22 	move(GUESSY, GUESSX + sizeof "Guessed: ");
23 	bp = Guessed;
24 	while (bp < &Guessed[26])
25 		if (*bp++)
26 			addch((bp - Guessed) + 'a' - 1);
27 	clrtoeol();
28 	mvprintw(NUMBERY, NUMBERX + sizeof "Word #:          ", "%d", Wordnum);
29 	mvprintw(AVGY, AVGX + sizeof       "Current Average: ", "%.3f",
30 				(Average * (Wordnum - 1) + Errors) / Wordnum);
31 	mvprintw(AVGY + 1, AVGX + sizeof   "Overall Average: ", "%.3f", Average);
32 }
33