Jan-Simon and my new versions of the mount commands
[unix-history] / usr / src / games / hangman / endgame.c
CommitLineData
81ded2d3 1/*
891bebb2
KB
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
81ded2d3 4 *
7c5ab767 5 * %sccs.include.redist.c%
81ded2d3
KB
6 */
7
8#ifndef lint
891bebb2 9static char sccsid[] = "@(#)endgame.c 8.1 (Berkeley) %G%";
81ded2d3
KB
10#endif /* not lint */
11
12# include "hangman.h"
13
14/*
15 * endgame:
16 * Do what's necessary at the end of the game
17 */
18endgame()
19{
20 register char ch;
21
22 prman();
23 if (Errors >= MAXERRS)
24 Errors = MAXERRS + 2;
25 prword();
26 prdata();
27 move(MESGY, MESGX);
28 if (Errors > MAXERRS)
29 printw("Sorry, the word was \"%s\"\n", Word);
30 else
31 printw("You got it!\n");
32
33 for (;;) {
34 mvaddstr(MESGY + 1, MESGX, "Another word? ");
35 leaveok(stdscr, FALSE);
36 refresh();
37 if ((ch = readch()) == 'n')
38 die();
39 else if (ch == 'y')
40 break;
41 mvaddstr(MESGY + 2, MESGX, "Please type 'y' or 'n'");
42 }
43
44 leaveok(stdscr, TRUE);
45 move(MESGY, MESGX);
83d22552
EA
46 deleteln();
47 deleteln();
48 deleteln();
81ded2d3 49}
83d22552
EA
50
51
52
53
54
55
56
57
58
59