diff options
author | Mark Murray <markm@FreeBSD.org> | 2002-10-21 07:40:27 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 2002-10-21 07:40:27 +0000 |
commit | 88001492142be07a49016a8cf7eff78171d59f64 (patch) | |
tree | b90261e8ce260fee190d0f359aa2884ddf2510de /games/hangman | |
parent | e05f78b8316cc4c48131cbc9093827a26f204680 (diff) | |
download | src-88001492142be07a49016a8cf7eff78171d59f64.tar.gz src-88001492142be07a49016a8cf7eff78171d59f64.zip |
Deorbit complete. We dont build these anymore, so into the attic they go.
Notes
Notes:
svn path=/head/; revision=105614
Diffstat (limited to 'games/hangman')
-rw-r--r-- | games/hangman/Makefile | 14 | ||||
-rw-r--r-- | games/hangman/endgame.c | 90 | ||||
-rw-r--r-- | games/hangman/extern.c | 78 | ||||
-rw-r--r-- | games/hangman/getguess.c | 114 | ||||
-rw-r--r-- | games/hangman/getword.c | 80 | ||||
-rw-r--r-- | games/hangman/hangman.6 | 51 | ||||
-rw-r--r-- | games/hangman/hangman.h | 92 | ||||
-rw-r--r-- | games/hangman/main.c | 84 | ||||
-rw-r--r-- | games/hangman/pathnames.h | 36 | ||||
-rw-r--r-- | games/hangman/playgame.c | 65 | ||||
-rw-r--r-- | games/hangman/prdata.c | 63 | ||||
-rw-r--r-- | games/hangman/prman.c | 60 | ||||
-rw-r--r-- | games/hangman/prword.c | 54 | ||||
-rw-r--r-- | games/hangman/setup.c | 78 |
14 files changed, 0 insertions, 959 deletions
diff --git a/games/hangman/Makefile b/games/hangman/Makefile deleted file mode 100644 index acabd3d381fa..000000000000 --- a/games/hangman/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $FreeBSD$ - -PROG= hangman -SRCS= endgame.c extern.c getguess.c getword.c main.c playgame.c \ - prdata.c prman.c prword.c setup.c -MAN= hangman.6 -DPADD= ${LIBCURSES} ${LIBCOMPAT} -LDADD= -lcurses -lcompat -HIDEGAME=hidegame - -.include <bsd.prog.mk> - - diff --git a/games/hangman/endgame.c b/games/hangman/endgame.c deleted file mode 100644 index a04908a2cee0..000000000000 --- a/games/hangman/endgame.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)endgame.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * endgame: - * Do what's necessary at the end of the game - */ -void -endgame() -{ - char ch; - - prman(); - if (Errors >= MAXERRS) - Errors = MAXERRS + 2; - prword(); - prdata(); - move(MESGY, MESGX); - if (Errors > MAXERRS) - printw("Sorry, the word was \"%s\"\n", Word); - else - printw("You got it!\n"); - - for (;;) { - mvaddstr(MESGY + 1, MESGX, "Another word? "); - leaveok(stdscr, FALSE); - refresh(); - if ((ch = readch()) == 'n') - die(0); - else if (ch == 'y') - break; - mvaddstr(MESGY + 2, MESGX, "Please type 'y' or 'n'"); - } - - leaveok(stdscr, TRUE); - move(MESGY, MESGX); - deleteln(); - deleteln(); - deleteln(); -} - - - - - - - - - - diff --git a/games/hangman/extern.c b/games/hangman/extern.c deleted file mode 100644 index 5561adc997b9..000000000000 --- a/games/hangman/extern.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -bool Guessed[26]; - -char Word[BUFSIZ], - Known[BUFSIZ], - *Noose_pict[] = { - " ______", - " | |", - " |", - " |", - " |", - " |", - " __|_____", - " | |___", - " |_________|", - NULL - }; - -int Errors, - Wordnum = 0; - -double Average = 0.0; - -ERR_POS Err_pos[MAXERRS] = { - { 2, 10, 'O' }, - { 3, 10, '|' }, - { 4, 10, '|' }, - { 5, 9, '/' }, - { 3, 9, '/' }, - { 3, 11, '\\' }, - { 5, 11, '\\' } -}; - -FILE *Dict = NULL; - -off_t Dict_size; diff --git a/games/hangman/getguess.c b/games/hangman/getguess.c deleted file mode 100644 index 4caaf0e144c3..000000000000 --- a/games/hangman/getguess.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)getguess.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -#include <sys/ttydefaults.h> -#include "hangman.h" - -/* - * getguess: - * Get another guess - */ -void -getguess() -{ - int i; - int ch; - bool correct; - - leaveok(stdscr, FALSE); - for (;;) { - move(PROMPTY, PROMPTX + sizeof "Guess: "); - refresh(); - ch = readch(); - if (isalpha(ch)) { - if (isupper(ch)) - ch = tolower(ch); - if (Guessed[ch - 'a']) - mvprintw(MESGY, MESGX, "Already guessed '%c'", ch); - else - break; - } - else if (ch == CTRL('D')) - die(0); - else - mvprintw(MESGY, MESGX, "Not a valid guess: '%s'", - unctrl(ch)); - } - leaveok(stdscr, TRUE); - move(MESGY, MESGX); - clrtoeol(); - - Guessed[ch - 'a'] = TRUE; - correct = FALSE; - for (i = 0; Word[i] != '\0'; i++) - if (Word[i] == ch) { - Known[i] = ch; - correct = TRUE; - } - if (!correct) - Errors++; -} - -/* - * readch; - * Read a character from the input - */ -char -readch() -{ - int cnt; - auto char ch; - - cnt = 0; - for (;;) { - if (read(0, &ch, sizeof ch) <= 0) - { - if (++cnt > 100) - die(0); - } - else if (ch == CTRL('L')) { - wrefresh(curscr); - mvcur(0, 0, curscr->_cury, curscr->_curx); - } - else - return ch; - } -} diff --git a/games/hangman/getword.c b/games/hangman/getword.c deleted file mode 100644 index 00246aa146f7..000000000000 --- a/games/hangman/getword.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -#include "hangman.h" -#include <stdlib.h> - -/* - * getword: - * Get a valid word out of the dictionary file - */ -void -getword() -{ - FILE *inf; - char *wp, *gp; - long pos; - - inf = Dict; - for (;;) { - pos = (double)random() / (RAND_MAX + 1.0) * (double)Dict_size; - fseek(inf, pos, 0); - if (fgets(Word, BUFSIZ, inf) == NULL) - continue; - if (fgets(Word, BUFSIZ, inf) == NULL) - continue; - Word[strlen(Word) - 1] = '\0'; - if (strlen(Word) < MINLEN) - continue; - for (wp = Word; *wp; wp++) - if (!islower(*wp)) - goto cont; - break; -cont: ; - } - gp = Known; - wp = Word; - while (*wp) { - *gp++ = '-'; - wp++; - } - *gp = '\0'; -} diff --git a/games/hangman/hangman.6 b/games/hangman/hangman.6 deleted file mode 100644 index e1ab323815ae..000000000000 --- a/games/hangman/hangman.6 +++ /dev/null @@ -1,51 +0,0 @@ -.\" Copyright (c) 1983, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)hangman.6 8.1 (Berkeley) 5/31/93 -.\" $FreeBSD$ -.\" -.TH HANGMAN 6 "May 31, 1993" -.UC 4 -.SH NAME -hangman \- the game of hangman -.SH SYNOPSIS -.B /usr/games/hangman -.SH DESCRIPTION -In -.I hangman, -the computer picks a word from the on-line word list -and you must try to guess it. -The computer keeps track of which letters have been guessed -and how many wrong guesses you have made on the screen in a graphic fashion. -.SH FILES -/usr/share/dict/words On-line word list -.SH AUTHOR -Ken Arnold diff --git a/games/hangman/hangman.h b/games/hangman/hangman.h deleted file mode 100644 index b8dacd9c26a1..000000000000 --- a/games/hangman/hangman.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)hangman.h 8.1 (Berkeley) 5/31/93 - * $FreeBSD$ - */ - -# include <stdlib.h> -# include <string.h> -# include <curses.h> -# include <sys/types.h> -# include <sys/stat.h> -# include <ctype.h> -# include <signal.h> -# include <unistd.h> -# include "pathnames.h" - -# define MINLEN 6 -# define MAXERRS 7 - -# define MESGY 12 -# define MESGX 0 -# define PROMPTY 11 -# define PROMPTX 0 -# define KNOWNY 10 -# define KNOWNX 1 -# define NUMBERY 4 -# define NUMBERX (COLS - 1 - 26) -# define AVGY 5 -# define AVGX (COLS - 1 - 26) -# define GUESSY 2 -# define GUESSX (COLS - 1 - 26) - - -typedef struct { - short y, x; - char ch; -} ERR_POS; - -extern bool Guessed[]; - -extern char Word[], Known[], *Noose_pict[]; - -extern int Errors, Wordnum; - -extern double Average; - -extern ERR_POS Err_pos[]; - -extern FILE *Dict; - -extern off_t Dict_size; - -void die(int); -void endgame(void); -void getguess(void); -void getword(void); -void playgame(void); -void prdata(void); -void prman(void); -void prword(void); -char readch(void); -void setup(void); diff --git a/games/hangman/main.c b/games/hangman/main.c deleted file mode 100644 index a948eea7338c..000000000000 --- a/games/hangman/main.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1983, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * This game written by Ken Arnold. - */ -int -main() -{ - - /* revoke */ - setgid(getgid()); - - initscr(); - signal(SIGINT, die); - setup(); - for (;;) { - Wordnum++; - playgame(); - Average = (Average * (Wordnum - 1) + Errors) / Wordnum; - } - /* NOTREACHED */ - exit(EXIT_FAILURE); -} - -/* - * die: - * Die properly. - */ -void -die(sig) -int sig; -{ - mvcur(0, COLS - 1, LINES - 1, 0); - endwin(); - putchar('\n'); - exit(0); -} diff --git a/games/hangman/pathnames.h b/games/hangman/pathnames.h deleted file mode 100644 index 41a7846a531f..000000000000 --- a/games/hangman/pathnames.h +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 - */ - -#define _PATH_DICT "/usr/share/dict/words" diff --git a/games/hangman/playgame.c b/games/hangman/playgame.c deleted file mode 100644 index 2059e392028b..000000000000 --- a/games/hangman/playgame.c +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)playgame.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * playgame: - * play a game - */ -void -playgame() -{ - bool *bp; - - getword(); - Errors = 0; - bp = Guessed; - while (bp < &Guessed[26]) - *bp++ = FALSE; - while (Errors < MAXERRS && index(Known, '-') != NULL) { - prword(); - prdata(); - prman(); - getguess(); - } - endgame(); -} diff --git a/games/hangman/prdata.c b/games/hangman/prdata.c deleted file mode 100644 index be9feffce217..000000000000 --- a/games/hangman/prdata.c +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)prdata.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * prdata: - * Print out the current guesses - */ -void -prdata() -{ - bool *bp; - - move(GUESSY, GUESSX + sizeof "Guessed: "); - bp = Guessed; - while (bp < &Guessed[26]) - if (*bp++) - addch((bp - Guessed) + 'a' - 1); - clrtoeol(); - mvprintw(NUMBERY, NUMBERX + sizeof "Word #: ", "%d", Wordnum); - mvprintw(AVGY, AVGX + sizeof "Current Average: ", "%.3f", - (Average * (Wordnum - 1) + Errors) / Wordnum); - mvprintw(AVGY + 1, AVGX + sizeof "Overall Average: ", "%.3f", Average); -} diff --git a/games/hangman/prman.c b/games/hangman/prman.c deleted file mode 100644 index 8e4f63f944a5..000000000000 --- a/games/hangman/prman.c +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)prman.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * prman: - * Print out the man appropriately for the give number - * of incorrect guesses. - */ -void -prman() -{ - int i; - - for (i = 0; i < Errors; i++) - mvaddch(Err_pos[i].y, Err_pos[i].x, Err_pos[i].ch); - while (i < MAXERRS) { - mvaddch(Err_pos[i].y, Err_pos[i].x, ' '); - i++; - } -} diff --git a/games/hangman/prword.c b/games/hangman/prword.c deleted file mode 100644 index ddc3ed33d15e..000000000000 --- a/games/hangman/prword.c +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)prword.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include "hangman.h" - -/* - * prword: - * Print out the current state of the word - */ -void -prword() -{ - move(KNOWNY, KNOWNX + sizeof "Word: "); - addstr(Known); - clrtoeol(); -} diff --git a/games/hangman/setup.c b/games/hangman/setup.c deleted file mode 100644 index 6889f8cc264b..000000000000 --- a/games/hangman/setup.c +++ /dev/null @@ -1,78 +0,0 @@ -/*- - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - -# include <stdlib.h> -# include "hangman.h" - -/* - * setup: - * Set up the strings on the screen. - */ -void -setup() -{ - char **sp; - static struct stat sbuf; - - noecho(); - crmode(); - - mvaddstr(PROMPTY, PROMPTX, "Guess:"); - mvaddstr(GUESSY, GUESSX, "Guessed:"); - mvaddstr(NUMBERY, NUMBERX, "Word #:"); - mvaddstr(AVGY, AVGX, "Current Average:"); - mvaddstr(AVGY + 1, AVGX, "Overall Average:"); - mvaddstr(KNOWNY, KNOWNX, "Word: "); - - for (sp = Noose_pict; *sp != NULL; sp++) { - move(sp - Noose_pict, 0); - addstr(*sp); - } - - srandomdev(); - if ((Dict = fopen(_PATH_DICT, "r")) == NULL) { - perror(_PATH_DICT); - endwin(); - exit(1); - } - fstat(fileno(Dict), &sbuf); - Dict_size = sbuf.st_size; -} |