mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-20 19:04:49 +00:00
add missing files
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9776 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
75
atc/include.h
Normal file
75
atc/include.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* $NetBSD: include.h,v 1.7 2001/08/29 18:23:44 jsm Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Ed James.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @(#)include.h 8.1 (Berkeley) 5/31/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved.
|
||||
*
|
||||
* Copy permission is hereby granted provided that this notice is
|
||||
* retained on all partial or complete copies.
|
||||
*
|
||||
* For more info on this and all of my stuff, mail edjames@berkeley.edu.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <curses.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "def.h"
|
||||
#include "struct.h"
|
||||
#include "extern.h"
|
||||
#include "tunable.h"
|
||||
185
backgammon/backgammon/backgammon.6.in
Normal file
185
backgammon/backgammon/backgammon.6.in
Normal file
@@ -0,0 +1,185 @@
|
||||
.\" $NetBSD: backgammon.6,v 1.9 2002/09/26 18:31:58 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 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.
|
||||
.\"
|
||||
.\" @(#)backgammon.6 8.1 (Berkeley) 5/31/93
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt BACKGAMMON 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm backgammon
|
||||
.Nd the game of backgammon
|
||||
.br
|
||||
.Nm teachgammon
|
||||
.Nd learn to play backgammon
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl
|
||||
.Op Fl nrwb
|
||||
.Op Fl pr
|
||||
.Op Fl pw
|
||||
.Op Fl pb
|
||||
.Op Fl t Ar term
|
||||
.Op Fl s Ar file
|
||||
.br
|
||||
.Nm teachgammon
|
||||
.Sh DESCRIPTION
|
||||
This program lets you play backgammon against the computer
|
||||
or against a "friend".
|
||||
All commands only are one letter, so you don't need to type a carriage return,
|
||||
except at the end of a move.
|
||||
The program is mostly self documenting,
|
||||
so that a question mark (?) will usually get some help.
|
||||
If you answer `y' when the program asks if you want the rules,
|
||||
you will get text explaining the rules of the game, some hints on strategy,
|
||||
instruction on how to use the program,
|
||||
and a tutorial consisting of a practice game against the computer.
|
||||
A description of how to use the program can be
|
||||
obtained by answering `y' when it asks if you want instructions.
|
||||
.Pp
|
||||
The possible arguments for backgammon
|
||||
(most are unnecessary but some are very convenient)
|
||||
consist of:
|
||||
.Bl -tag -width indent
|
||||
.It Fl n
|
||||
don't ask for rules or instructions
|
||||
.It Fl r
|
||||
player is red (implies n)
|
||||
.It Fl w
|
||||
player is white (implies n)
|
||||
.It Fl b
|
||||
two players, red and white (implies n)
|
||||
.It Fl pr
|
||||
print the board before red's turn
|
||||
.It Fl pw
|
||||
print the board before white's turn
|
||||
.It Fl pb
|
||||
print the board before both player's turn
|
||||
.It Fl t Ar term
|
||||
terminal is type
|
||||
.Ar term ,
|
||||
uses
|
||||
.Pa /usr/share/misc/termcap
|
||||
.It Fl s Ar file
|
||||
recover previously saved game from
|
||||
.Ar file .
|
||||
.El
|
||||
.Pp
|
||||
.\"
|
||||
.\" Arguments may be optionally preceded by a `-'.
|
||||
.\" Several arguments may be concatenated together,
|
||||
.\" but not after `s' or `t' arguments,
|
||||
.\" since they can be followed by an arbitrary string.
|
||||
Any unrecognized arguments are ignored.
|
||||
An argument of a lone `-' gets a description of possible arguments.
|
||||
.Pp
|
||||
If
|
||||
.Ar term
|
||||
has capabilities for direct cursor movement (see
|
||||
.Xr termcap 5 )
|
||||
.Nm
|
||||
``fixes'' the board after each move,
|
||||
so the board does not need to be reprinted,
|
||||
unless the screen suffers some horrendous malady.
|
||||
Also, any `p' option will be ignored.
|
||||
(The `t' option is not necessary unless the terminal type does not match
|
||||
the entry in the
|
||||
.Pa /usr/share/misc/termcap
|
||||
data base.)
|
||||
.Sh QUICK REFERENCE
|
||||
When the program prompts by typing only your color,
|
||||
type a space or carriage return to roll, or
|
||||
.Bl -tag -width indent
|
||||
.It Ic d
|
||||
to double
|
||||
.It Ic p
|
||||
to print the board
|
||||
.It Ic q
|
||||
to quit
|
||||
.It Ic s
|
||||
to save the game for later
|
||||
.El
|
||||
.Pp
|
||||
When the program prompts with 'Move:', type
|
||||
.Bl -tag -width indent
|
||||
.It Ic p
|
||||
to print the board
|
||||
.It Ic q
|
||||
to quit
|
||||
.It Ic s
|
||||
to save the game
|
||||
.El
|
||||
.Pp
|
||||
or a
|
||||
.Em move ,
|
||||
which is a sequence of
|
||||
.Bl -tag -width indent
|
||||
.It Ic s-f
|
||||
move from
|
||||
.Ic s
|
||||
to
|
||||
.Ic f
|
||||
.It Ic s/r
|
||||
move one man on
|
||||
.Ic s
|
||||
the roll
|
||||
.Ic r
|
||||
separated by commas or spaces and ending with a newline.
|
||||
Available abbreviations are
|
||||
.Bl -tag -width indent
|
||||
.It Ic s-f1-f2
|
||||
means
|
||||
.Ic s-f1,f1-f2
|
||||
.It Ic s/r1r2
|
||||
means
|
||||
.Ic s/r1,s/r2
|
||||
.El
|
||||
.El
|
||||
.Pp
|
||||
Use
|
||||
.Ic b
|
||||
for bar and
|
||||
.Ic h
|
||||
for home,
|
||||
or 0 or 25 as appropriate.
|
||||
.Sh AUTHOR
|
||||
.An Alan Char
|
||||
.Sh FILES
|
||||
.Bl -tag -width /usr/share/misc/termcap -compact
|
||||
.It Pa @gamesdir@/teachgammon
|
||||
rules and tutorial
|
||||
.It Pa /usr/share/misc/termcap
|
||||
terminal capabilities
|
||||
.El
|
||||
.Sh BUGS
|
||||
The program's strategy needs much work.
|
||||
5
backgammon/common_source/.cvsignore
Normal file
5
backgammon/common_source/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
6
backgammon/teachgammon/.cvsignore
Normal file
6
backgammon/teachgammon/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
teachgammon
|
||||
125
boggle/boggle/timer.c
Normal file
125
boggle/boggle/timer.c
Normal file
@@ -0,0 +1,125 @@
|
||||
/* $NetBSD: timer.c,v 1.7 2002/09/19 21:26:56 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Barry Brachman.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)timer.c 8.2 (Berkeley) 2/22/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: timer.c,v 1.7 2002/09/19 21:26:56 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <curses.h>
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "bog.h"
|
||||
#include "extern.h"
|
||||
|
||||
static int waitch __P((int));
|
||||
|
||||
extern int tlimit;
|
||||
extern time_t start_t;
|
||||
extern jmp_buf env;
|
||||
|
||||
/*
|
||||
* Update the display of the remaining time while waiting for a character
|
||||
* If time runs out do a longjmp() to the game controlling routine, returning
|
||||
* non-zero; oth. return the character
|
||||
* Leave the cursor where it was initially
|
||||
*/
|
||||
int
|
||||
timerch()
|
||||
{
|
||||
time_t prevt, t;
|
||||
int col, remaining, row;
|
||||
|
||||
getyx(stdscr, row, col);
|
||||
prevt = 0L;
|
||||
for (;;) {
|
||||
if (waitch(1) == 1)
|
||||
break;
|
||||
time(&t);
|
||||
if (t == prevt)
|
||||
continue;
|
||||
prevt = t;
|
||||
remaining = tlimit - (int) (t - start_t);
|
||||
if (remaining < 0) {
|
||||
longjmp(env, 1);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
move(TIMER_LINE, TIMER_COL);
|
||||
printw("%d:%02d", remaining / 60, remaining % 60);
|
||||
move(row, col);
|
||||
refresh();
|
||||
}
|
||||
return (getch() & 0177);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait up to 'delay' microseconds for input to appear
|
||||
* Returns 1 if input is ready, 0 oth.
|
||||
*/
|
||||
static int
|
||||
waitch(delay)
|
||||
int delay;
|
||||
{
|
||||
struct pollfd set[1];
|
||||
|
||||
set[0].fd = STDIN_FILENO;
|
||||
set[0].events = POLLIN;
|
||||
return (poll(set, 1, delay));
|
||||
}
|
||||
|
||||
void
|
||||
delay(tenths)
|
||||
int tenths;
|
||||
{
|
||||
struct timespec duration;
|
||||
|
||||
duration.tv_nsec = (tenths % 10 ) * 100000000L;
|
||||
duration.tv_sec = (long) (tenths / 10);
|
||||
nanosleep(&duration, NULL);
|
||||
}
|
||||
7
boggle/mkdict/.cvsignore
Normal file
7
boggle/mkdict/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
mkdict
|
||||
dictionary
|
||||
7
boggle/mkindex/.cvsignore
Normal file
7
boggle/mkindex/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
mkindex
|
||||
dictindex
|
||||
126
canfield/canfield/canfield.6.in
Normal file
126
canfield/canfield/canfield.6.in
Normal file
@@ -0,0 +1,126 @@
|
||||
.\" $NetBSD: canfield.6,v 1.8 2002/09/26 18:32:00 wiz Exp $
|
||||
.\"
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" @(#)canfield.6 8.1 (Berkeley) 5/31/93
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt CANFIELD 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm canfield ,
|
||||
.Nm cfscores
|
||||
.Nd the solitaire card game canfield
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Nm cfscores
|
||||
.Op Fl a
|
||||
.Op Ar user
|
||||
.Sh DESCRIPTION
|
||||
If you have never played solitaire before, it is recommended
|
||||
that you consult a solitaire instruction book. In
|
||||
Canfield, tableau cards may be built on each other downward
|
||||
in alternate colors. An entire pile must be moved as a unit
|
||||
in building. Top cards of the piles are available
|
||||
to be played on foundations, but never into empty spaces.
|
||||
.Pp
|
||||
Spaces must be filled from the stock. The top card of
|
||||
the stock also is available to be played on foundations or
|
||||
built on tableau piles. After the stock is exhausted,
|
||||
tableau spaces may be filled from the talon and the player may
|
||||
keep them open until he wishes to use them.
|
||||
.Pp
|
||||
Cards are dealt from the hand to the talon by threes
|
||||
and this repeats until there are no more cards in the hand
|
||||
or the player quits.
|
||||
To have cards dealt onto the talon the player types
|
||||
.Sq Ic ht
|
||||
for his move.
|
||||
Foundation base cards are also automatically moved to the foundation
|
||||
when they become available.
|
||||
.Pp
|
||||
The command
|
||||
.Sq Ic c
|
||||
causes
|
||||
.Nm
|
||||
to maintain card counting statistics on the bottom of the screen.
|
||||
When properly used this can greatly increase one's chances of winning.
|
||||
.Pp
|
||||
The rules for betting are somewhat less strict than
|
||||
those used in the official version of the game.
|
||||
The initial deal costs $13.
|
||||
You may quit at this point or inspect the game.
|
||||
Inspection costs $13 and allows you to make as many
|
||||
moves as possible without moving any cards from your hand to the talon.
|
||||
(The initial deal places three cards on the talon;
|
||||
if all these cards are used, three more are made available.)
|
||||
Finally, if the game seems interesting,
|
||||
you must pay the final installment of $26.
|
||||
At this point you are
|
||||
credited at the rate of $5 for each card on the foundation;
|
||||
as the game progresses you are credited with $5 for each
|
||||
card that is moved to the foundation.
|
||||
Each run through the hand after the first costs $5.
|
||||
The card counting feature
|
||||
costs $1 for each unknown card that is identified.
|
||||
If the information is toggled on, you are only charged for cards
|
||||
that became visible since it was last turned on.
|
||||
Thus the maximum cost of information is $34.
|
||||
Playing time is charged at a rate of $1 per minute.
|
||||
.Pp
|
||||
With no arguments, the program
|
||||
.Nm cfscores
|
||||
prints out the current status of your canfield account.
|
||||
If a
|
||||
.Ar user
|
||||
name is specified, it prints out the status of their canfield account.
|
||||
If the
|
||||
.Fl a
|
||||
flag is specified,
|
||||
it prints out the canfield accounts for all users that have
|
||||
played the game since the database was set up.
|
||||
.Sh FILES
|
||||
.Bl -tag -width @gamesdir@/canfield -compact
|
||||
.It Pa @gamesdir@/canfield
|
||||
the game itself
|
||||
.It Pa @gamesdir@/cfscores
|
||||
the database printer
|
||||
.It Pa @canfield_scorefile@
|
||||
the database of scores
|
||||
.El
|
||||
.Sh BUGS
|
||||
It is impossible to cheat.
|
||||
.Sh AUTHORS
|
||||
Originally written: Steve Levine.
|
||||
.Pp
|
||||
Further random hacking by: Steve Feldman, Kirk McKusick,
|
||||
Mikey Olson, and Eric Allman.
|
||||
11
canfield/cfscores/Makefile.bsd
Normal file
11
canfield/cfscores/Makefile.bsd
Normal file
@@ -0,0 +1,11 @@
|
||||
# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:40 lukem Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
NOMAN= # defined
|
||||
|
||||
PROG= cfscores
|
||||
CPPFLAGS+= -I${.CURDIR}/../canfield
|
||||
HIDEGAME= hidegame
|
||||
|
||||
.include "../../Makefile.inc"
|
||||
.include <bsd.prog.mk>
|
||||
77
fortune/datfiles/Makefile.bsd
Normal file
77
fortune/datfiles/Makefile.bsd
Normal file
@@ -0,0 +1,77 @@
|
||||
# $NetBSD: Makefile,v 1.33 2002/10/22 16:14:04 drochner Exp $
|
||||
# @(#)Makefile 8.2 (Berkeley) 4/19/94
|
||||
|
||||
.include <bsd.own.mk> # for INSTALL_OFFENSIVE_FORTUNES
|
||||
|
||||
SRCFILES= fortunes fortunes2 startrek zippy unamerican-o limerick \
|
||||
netbsd farber
|
||||
DATFILES= fortunes.dat fortunes2.dat startrek.dat zippy.dat \
|
||||
fortunes-o fortunes-o.dat fortunes2-o fortunes2-o.dat \
|
||||
limerick.dat limerick-o limerick-o.dat unamerican-o \
|
||||
unamerican-o.dat netbsd.dat netbsd-o netbsd-o.dat \
|
||||
farber.dat
|
||||
|
||||
# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, RUN 'make' with
|
||||
# "INSTALL_OFFENSIVE_FORTUNES=NO", or set "INSTALL_OFFENSIVE_FORTUNES=NO"
|
||||
# IN bsd.own.mk OR /etc/mk.conf.
|
||||
|
||||
INSTALL_OFFENSIVE_FORTUNES?= YES
|
||||
.if (${INSTALL_OFFENSIVE_FORTUNES} == "YES")
|
||||
TYPE= real
|
||||
.else
|
||||
TYPE= fake
|
||||
.endif
|
||||
|
||||
CLEANFILES+=${DATFILES}
|
||||
|
||||
STRFILEDIR!=cd $(.CURDIR)/../strfile; ${PRINTOBJDIR}
|
||||
STRFILE=${STRFILEDIR}/strfile
|
||||
|
||||
.if ${MKSHARE} != "no"
|
||||
FILES=${SRCFILES} ${DATFILES}
|
||||
FILESDIR=/usr/share/games/fortune
|
||||
.endif
|
||||
|
||||
realall: ${DATFILES}
|
||||
|
||||
# Normal fortunes: build directly from data files.
|
||||
|
||||
fortunes.dat fortunes2.dat startrek.dat zippy.dat limerick.dat netbsd.dat farber.dat:
|
||||
${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
|
||||
fortunes.dat: fortunes
|
||||
fortunes2.dat: fortunes2
|
||||
startrek.dat: startrek
|
||||
zippy.dat: zippy
|
||||
limerick.dat: limerick
|
||||
netbsd.dat: netbsd
|
||||
farber.dat: farber
|
||||
|
||||
# Obscene fortunes: we have to build source and data files
|
||||
|
||||
fortunes-o: fortunes-o.${TYPE}
|
||||
tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET}
|
||||
fortunes-o.dat: fortunes-o
|
||||
${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
|
||||
|
||||
fortunes2-o: fortunes2-o.${TYPE}
|
||||
tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET}
|
||||
fortunes2-o.dat: fortunes2-o
|
||||
${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
|
||||
|
||||
limerick-o: limerick-o.${TYPE}
|
||||
tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET}
|
||||
limerick-o.dat: limerick-o
|
||||
${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
|
||||
|
||||
unamerican-o: unamerican-o.${TYPE}
|
||||
tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET}
|
||||
unamerican-o.dat: unamerican-o
|
||||
${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
|
||||
|
||||
netbsd-o: netbsd-o.${TYPE}
|
||||
tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET}
|
||||
netbsd-o.dat: netbsd-o
|
||||
${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
|
||||
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
16287
fortune/datfiles/fortunes
Normal file
16287
fortune/datfiles/fortunes
Normal file
File diff suppressed because it is too large
Load Diff
55876
fortune/datfiles/fortunes2
Normal file
55876
fortune/datfiles/fortunes2
Normal file
File diff suppressed because it is too large
Load Diff
15334
fortune/datfiles/fortunes2-o.real
Normal file
15334
fortune/datfiles/fortunes2-o.real
Normal file
File diff suppressed because it is too large
Load Diff
50
fortune/datfiles/limerick
Normal file
50
fortune/datfiles/limerick
Normal file
@@ -0,0 +1,50 @@
|
||||
A computer called Illiac4
|
||||
Had a rather tough bug in its core.
|
||||
It chewed up its cards
|
||||
And spewed yards and yards
|
||||
Of illegible tape on the floor.
|
||||
%
|
||||
A computer, to print out a fact,
|
||||
Will divide, multiply, and subtract.
|
||||
But this output can be
|
||||
No more than debris,
|
||||
If the input was short of exact.
|
||||
-- Gigo
|
||||
%
|
||||
A dreary young bank clerk named Fennis
|
||||
Wished to foster an aura of menace;
|
||||
To make people afraid
|
||||
He wore gloves of grey suede
|
||||
And white footgear intended for tennis.
|
||||
-- Edward Gorey
|
||||
%
|
||||
A hacker who screwed a mag tape
|
||||
Was caught and convicted of rape.
|
||||
To jail he did go,
|
||||
From which, to his woe
|
||||
He couldn't get out with ESC.
|
||||
%
|
||||
A linguist thought it a farce
|
||||
That memory space was so sparse.
|
||||
One day they increased it.
|
||||
Said he as he seized it:
|
||||
"At last! Enough core for the parse".
|
||||
%
|
||||
A progressive professor named Winners
|
||||
Held classes each evening for sinners.
|
||||
They were graded and spaced
|
||||
So the vile and debased
|
||||
Would not be held back by beginners.
|
||||
%
|
||||
A very intelligent turtle
|
||||
Found programming UNIX a hurdle
|
||||
The system, you see,
|
||||
Ran as slow as did he,
|
||||
And that's not saying much for the turtle.
|
||||
%
|
||||
There was a young lady from Niger
|
||||
Who smiled as she rode on a tiger;
|
||||
They returned from the ride
|
||||
With the lady inside,
|
||||
And the smile on the face of the tiger.
|
||||
%
|
||||
543
fortune/datfiles/netbsd
Normal file
543
fortune/datfiles/netbsd
Normal file
@@ -0,0 +1,543 @@
|
||||
|
||||
%____ __ _ ____ __ __ ___ ___ ___
|
||||
___ / | / /__ _/ /_ / |/ __\ / _ |
|
||||
__ / |/ // _\/_ _/ / ' / \_ \ / / /
|
||||
_ / /| // __/ / /_ / , | __/ // / ,/
|
||||
/_/ |__/_\__/__\__//___/__\__//___'
|
||||
-- Greywolf
|
||||
%
|
||||
- What's up?
|
||||
- All the NetBSD servers, of course..
|
||||
-- Gavan Fantom
|
||||
%
|
||||
A _Real_ Operating System for _Real_ Hackers.
|
||||
-- Greywolf
|
||||
%
|
||||
Anagrams for NetBSD core team:
|
||||
Breasted cot men
|
||||
Embraces dot net
|
||||
Strobed teen cam
|
||||
Aborted men sect
|
||||
Emtomb DEC tears
|
||||
-- Julian Assange
|
||||
%
|
||||
Anagrams for NetBSD core team:
|
||||
Crested Boatmen
|
||||
Resented Combat
|
||||
Boast Decrement
|
||||
Basement DEC rot
|
||||
-- Julian Assange
|
||||
%
|
||||
Anagrams for NetBSD-core:
|
||||
Bent Coders
|
||||
Secret Bond
|
||||
Robs DECNet
|
||||
Cost Bender
|
||||
-- Julian Assange
|
||||
%
|
||||
Anagrams for NetBSD-core:
|
||||
Cot Benders
|
||||
Be stern, Doc.
|
||||
Net robs DEC
|
||||
DEC robs Net
|
||||
-- Julian Assange
|
||||
%
|
||||
http://www.imrryr.org/NetBSD/logo
|
||||
-- R. C. Dowdeswell
|
||||
%
|
||||
I didn't get where I am today without using NetBSD
|
||||
-- Dave Tyson
|
||||
%
|
||||
My other computer runs NetBSD
|
||||
-- Allen Briggs
|
||||
%
|
||||
NetBSD - a devil of an operating system.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - A Mycroft in every port.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - a server in every port.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - because Unix isn't just #include <linux.h>, i386, ELF, ...!
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
NetBSD - big, isn't it?
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - daemonic power
|
||||
-- R. C. Dowdeswell
|
||||
%
|
||||
NetBSD: Flying into the heart of the Sun. And the i386, and alpha,
|
||||
and mac, and powerpc, and...
|
||||
-- Greywolf
|
||||
%
|
||||
NetBSD - free yourself from all Stallmanist thought!
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD: Got source?
|
||||
%
|
||||
NetBSD - hackers tested, mom approved
|
||||
-- Ken Nakata
|
||||
%
|
||||
NetBSD - here today and in the middle of 2038 tomorrow.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - Mach 3 stealthOS, undetectable by media radar.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - more is more.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD: No Windows or Gates, but lots of doors, portals and tunnels.
|
||||
-- Greywolf
|
||||
%
|
||||
NetBSD - penguin flesh never tasted so good.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - posix me harder.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD: Post No Bills.
|
||||
-- Greywolf
|
||||
%
|
||||
NetBSD - safe ports in a storm.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - Scalability Does Matter.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - Serious Other, or Serious Operating system. Your choice.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the Berkeley redemption.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the cathedral versus the bizarre.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the cure.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the devil finds work for idle cycles.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the devil made me do it.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the devil's advocate.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the devil's not just in vaudeville.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the power to suave.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - the power to swerve (penguins, worse than cane toads).
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD: The Source is out there.
|
||||
-- Greywolf
|
||||
%
|
||||
NetBSD - The undiscriminated geek UNIX
|
||||
-- Richard Rauch
|
||||
%
|
||||
NetBSD - we have nothing to declare but our benchmarks.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - we put the Net in NetBSD.
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - We're not in canvas anymore, toto
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - where do you want to go Tuesday?
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD - Will even run on i386
|
||||
-- Brian Hechinger
|
||||
%
|
||||
NetBSD - your basement or mine?
|
||||
-- Julian Assange
|
||||
%
|
||||
NetBSD: A drinking group with a serious computing problem.
|
||||
%
|
||||
NetBSD: A pmap for every occasion.
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD: Abandon all hype, oh ye who enter here.
|
||||
%
|
||||
NetBSD: Agnostics in the Platform Religious Wars.
|
||||
-- Erik E. Fair
|
||||
%
|
||||
NetBSD: An Operating System For Everyone
|
||||
-- Mike Latinovich
|
||||
%
|
||||
NetBSD: Are you old enough to run it?
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: Beyond Windows
|
||||
-- Johan Ihren
|
||||
%
|
||||
NetBSD: CD-ROMs? We don't need no stinkin' CD-ROMs!
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: Choose Your Own Slogan
|
||||
-- Dirk Myers
|
||||
%
|
||||
NetBSD: Compatible with the Real World.
|
||||
-- Greywolf
|
||||
%
|
||||
NetBSD: Dave Barry is working on our motto
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: demonic power.
|
||||
-- R. C. Dowdeswell
|
||||
%
|
||||
NetBSD: Designed to be {secure, reliable, portable, CORRECT}
|
||||
-- Matthew Orgass
|
||||
%
|
||||
NetBSD: Download one, get ${NUMPORTS}-1 for free.
|
||||
%
|
||||
NetBSD: Empowering the VAX generation.
|
||||
-- Andy Doran
|
||||
%
|
||||
NetBSD: Everyone else is doin' it. But we're doin' it right.
|
||||
-- Herb Peyerl
|
||||
%
|
||||
NetBSD, Feed The Computer.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Flexible and free!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: For The Network Generation
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Get Over It.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Groovy Baby!
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD home page: Ultra-heavy use of blink text, hot colours, and
|
||||
Flash plug-ins. All shockwave, all the time. Background music
|
||||
ought to be a mixture of Phillip Glass overlaid on top of
|
||||
Sublime.
|
||||
-- Mason Loring Bliss
|
||||
%
|
||||
NetBSD: I Wanna Be Sedated
|
||||
-- Curt Sampson
|
||||
%
|
||||
NetBSD: If you look through Windows
|
||||
-- Johan Ihren
|
||||
%
|
||||
NetBSD: If your server could choose, it would choose NetBSD
|
||||
-- Tim Rightnour
|
||||
%
|
||||
NetBSD, In Stalls Anywhere
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD is full. Go away.
|
||||
-- Chris Baird <cjb@brushtail.apana.org.au>
|
||||
%
|
||||
NetBSD is much like a tipi: No windows, no gates, and an apache inside.
|
||||
%
|
||||
NetBSD is PAR -- Powerful, Advanced, Reliable. Is your OS up to PAR?
|
||||
-- Frank Warren
|
||||
%
|
||||
NetBSD is the bomb. (ok, bad idea)
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: It keeps on going...and going...and going...
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: It spanks the knickers off those other operating systems
|
||||
-- Brian D Chase
|
||||
%
|
||||
NetBSD: it'll be there when you're ready for it
|
||||
-- Greg Lehey
|
||||
%
|
||||
NetBSD: it's not free beer, but it's free
|
||||
%
|
||||
NetBSD: Its not Windows.
|
||||
-- Paul Wain
|
||||
%
|
||||
NetBSD: It's...uh...well...have you heard of linux?
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: lets get it right
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD: Linux without the hype.
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
NetBSD: making all computer hardware a commodity.
|
||||
-- Erik E. Fair
|
||||
%
|
||||
NetBSD: Making your net work, and its free to boot!
|
||||
-- Steve Woodford
|
||||
%
|
||||
NetBSD: Masterly with distinction. Striking also.
|
||||
-- Andy Doran
|
||||
%
|
||||
NetBSD: May the Source be with you
|
||||
-- Greg Earle
|
||||
%
|
||||
NetBSD: Microsoft ask you where you want to go, NetBSD gets you there
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD, More Nines.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Multi-platform OS
|
||||
%
|
||||
NetBSD: My Computer Runs!
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: My Computer Works!
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: My other computer also runs NetBSD.
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD, Net Improvement.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD, Net Profit.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD, Net Some Nines.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Network Power Unleashed.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Network Your World.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Networking Space
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: No hype required.
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD, No Worries!
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Not all of the First Ones have gone away.
|
||||
%
|
||||
NetBSD. Not Guano.
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
NetBSD: Not your mother's OS (unless you are P. Seebach)
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: Oh my god! They support my hardware! You hackers!
|
||||
%
|
||||
NetBSD: Perpetual performance!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: Pink fluffy chunks or green bits - the choice is yours.
|
||||
-- Andy Doran
|
||||
%
|
||||
NetBSD: Ports to * boards.
|
||||
-- Steve Woodford
|
||||
%
|
||||
NetBSD: Power Your Net.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: preferred by Rocket Scientists and Moms!
|
||||
-- Steven J. Dovich
|
||||
%
|
||||
NetBSD: priapic OS
|
||||
-- Perry Metzger
|
||||
%
|
||||
NetBSD: Professionalpower!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: "Progress on your system is closer than it appears."
|
||||
%
|
||||
NetBSD: Raiders of the Lost Arch
|
||||
%
|
||||
NetBSD: Re: NetBSD Slogans
|
||||
-- Mirian Crzig Lennox
|
||||
%
|
||||
NetBSD: Resistance is futile! You will be supported.
|
||||
-- Peter Seebach
|
||||
%
|
||||
NetBSD: Resistance is NOT futile!
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
NetBSD: Rock solid!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: Servers' choice!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: serves you right.
|
||||
-- Herb Peyerl
|
||||
%
|
||||
NetBSD short theme, for stickers and tattoos: NetBSD... Bitchin'!
|
||||
-- Mason Loring Bliss
|
||||
%
|
||||
NetBSD, SIMMs Like Good Code
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: Someday, we won't burn your toast
|
||||
-- Herb Peyerl
|
||||
%
|
||||
NetBSD: Stable and strong!
|
||||
-- Lars-Johan Liman
|
||||
%
|
||||
NetBSD: Stop, Drop, and Load
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD, Tap The Power
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: The choice of hundreds worldwide
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: The Final Frontier
|
||||
-- Chris Jones
|
||||
%
|
||||
NetBSD: The free OS with a money back guarantee!
|
||||
-- Tim Rightnour
|
||||
%
|
||||
NetBSD: the free unix for the rest of us
|
||||
-- Bob Nestor
|
||||
%
|
||||
NetBSD: The Last Bastion of the true UNIX Religion.
|
||||
-- Miles Nordin
|
||||
%
|
||||
NetBSD: The OS WORM - Write Once, Run Many
|
||||
%
|
||||
NetBSD: The Power of Code
|
||||
-- Mason Loring Bliss
|
||||
%
|
||||
NetBSD: The power to Connect
|
||||
-- Feico Dillema
|
||||
%
|
||||
NetBSD: The power to serve, also
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: The power to serve, on the platform of your choice
|
||||
-- John Darrow
|
||||
%
|
||||
NetBSD: the second best thing you can get for free
|
||||
%
|
||||
NetBSD: the server is up
|
||||
-- David Brownlee
|
||||
%
|
||||
NetBSD: The Worlds Most Portable Operating System
|
||||
%
|
||||
NetBSD/toaster: we wish the toaster to be happy too.
|
||||
%
|
||||
NetBSD: To serve the power.
|
||||
-- Herb Peyerl
|
||||
%
|
||||
NetBSD: true inheritors of the UNIX(tm) legacy.
|
||||
-- Erik E. Fair
|
||||
%
|
||||
NetBSD: Twice the Bits-Clean of other Leading OSes
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: Two guys with a vax
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: u_long uptime;
|
||||
-- Herb Peyerl
|
||||
%
|
||||
NetBSD: unshackling hardware designers and users from the bondage
|
||||
of WinTel.
|
||||
-- Erik E. Fair
|
||||
%
|
||||
NetBSD: Use the ENTIRE computer!
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: userland included
|
||||
%
|
||||
NetBSD: We Come In Peace.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: We come in peace. We offer reliability.
|
||||
-- David Maxwell
|
||||
%
|
||||
NetBSD: We do it right.
|
||||
-- Perry Metzger
|
||||
%
|
||||
NetBSD: We don't negotiate with terrorists.
|
||||
-- Miles Nordin
|
||||
%
|
||||
NetBSD: We put the "Net" in "BSD", and took out the "Free"
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: We Stay Up.
|
||||
-- Andrew Gillham
|
||||
%
|
||||
NetBSD: We Suck Less
|
||||
%
|
||||
NetBSD: We're so committed to it being free, we won't sell it to you
|
||||
even if you ask!
|
||||
-- Charles M. Hannum
|
||||
%
|
||||
NetBSD: What do you want to serve today?
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
NetBSD: When Linux ports to that platform, they will discover -
|
||||
WE HAVE ALWAYS BEEN HERE
|
||||
-- David Maxwell
|
||||
%
|
||||
NetBSD: Where do you want to have the power to serve, tomorrow?
|
||||
-- Tom Harvey
|
||||
%
|
||||
NetBSD: Who do you Serve? And who do you Trust?
|
||||
-- David Maxwell
|
||||
%
|
||||
NetBSD will put hair on a UNIX admin's chest
|
||||
-- Jason R. Fink
|
||||
%
|
||||
NetBSD: Write Once, Run Everywhere. Java optional.
|
||||
-- Todd Whitesel
|
||||
%
|
||||
NetBSD: You can't handle it.
|
||||
-- Paul Newhouse
|
||||
%
|
||||
NetBSD: You choose the hardware, we'll bring the OS.
|
||||
-- David Brownlee
|
||||
%
|
||||
Of course it runs NetBSD.
|
||||
%
|
||||
Portable. Supportable. NetBSD.
|
||||
-- Jim Wise
|
||||
%
|
||||
Software is like sex - it should be free
|
||||
-- Hubert Feyrer
|
||||
%
|
||||
We're BSD. If you want System V, you know where to get it.
|
||||
-- Greywolf
|
||||
%
|
||||
Where would you have rather been today, tomorrow? NetBSD.
|
||||
-- Allen Briggs
|
||||
%
|
||||
With many thanks to the core team and UCB CSRG.
|
||||
-- Greywolf
|
||||
%
|
||||
Young or old; cutting edge or yesterday's NeWS, NetBSD is the UNIX for you.
|
||||
It can be a hulking monster in your basement, or fit in the palm
|
||||
of your hand.
|
||||
-- Richard Rauch
|
||||
%
|
||||
#netbsd - where monks recite their internal dialogue while debugging.
|
||||
-- Bernhard Riedel
|
||||
%
|
||||
I held off from Uni until NetBSD came out.
|
||||
I decided, ``if there's no NetBSD then I'll just flip burgers''
|
||||
-- Roland Dowdeswell
|
||||
%
|
||||
NetBSD - love all, serve all.
|
||||
-- Silke Mueller
|
||||
%
|
||||
171
fortune/fortune/fortune.6.in
Normal file
171
fortune/fortune/fortune.6.in
Normal file
@@ -0,0 +1,171 @@
|
||||
.\" $NetBSD: fortune.6,v 1.9 2002/09/26 18:32:01 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1985, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" Ken Arnold.
|
||||
.\"
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" @(#)fortune.6 8.3 (Berkeley) 4/19/94
|
||||
.\"
|
||||
.Dd April 19, 1994
|
||||
.Dt FORTUNE 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm fortune
|
||||
.Nd print a random, hopefully interesting, adage
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl aefilosw
|
||||
.Op Fl m Ar pattern
|
||||
.Oo
|
||||
.Op Ar N%
|
||||
.Ar file/dir/all
|
||||
.Oc
|
||||
.Sh DESCRIPTION
|
||||
When
|
||||
.Nm
|
||||
is run with no arguments it prints out a random epigram.
|
||||
Epigrams are divided into several categories, where each category
|
||||
is subdivided into those which are potentially offensive and those
|
||||
which are not.
|
||||
The options are as follows:
|
||||
.Bl -tag -width flag
|
||||
.It Fl a
|
||||
Choose from all lists of maxims, both offensive and not.
|
||||
(See the
|
||||
.Fl o
|
||||
option for more information on offensive fortunes.)
|
||||
.It Fl e
|
||||
Consider all fortune files to be of equal size (see discussion below
|
||||
on multiple files).
|
||||
.It Fl f
|
||||
Print out the list of files which would be searched, but don't
|
||||
print a fortune.
|
||||
.It Fl l
|
||||
Long dictums only.
|
||||
.It Fl m
|
||||
Print out all fortunes which match the regular expression
|
||||
.Ar pattern .
|
||||
See
|
||||
.Xr regex 3
|
||||
for a description of patterns.
|
||||
.It Fl o
|
||||
Choose only from potentially offensive aphorisms.
|
||||
.Bf -symbolic
|
||||
Please, please, please request a potentially offensive fortune if and
|
||||
only if you believe, deep down in your heart, that you are willing
|
||||
to be offended.
|
||||
(And that if you are, you'll just quit using
|
||||
.Fl o
|
||||
rather than give us grief about it, okay?)
|
||||
.Ef
|
||||
.Bd -filled -offset indent
|
||||
\&... let us keep in mind the basic governing philosophy
|
||||
of The Brotherhood, as handsomely summarized in these words:
|
||||
we believe in healthy, hearty laughter -- at the expense of
|
||||
the whole human race, if needs be.
|
||||
Needs be.
|
||||
.Bd -filled -offset indent-two -compact
|
||||
--H. Allen Smith, "Rude Jokes"
|
||||
.Ed
|
||||
.Ed
|
||||
.It Fl s
|
||||
Short apothegms only.
|
||||
.It Fl i
|
||||
Ignore case for
|
||||
.Fl m
|
||||
patterns.
|
||||
.It Fl w
|
||||
Wait before termination for an amount of time calculated from the
|
||||
number of characters in the message.
|
||||
This is useful if it is executed as part of the logout procedure
|
||||
to guarantee that the message can be read before the screen is cleared.
|
||||
.El
|
||||
.Pp
|
||||
The user may specify alternative sayings.
|
||||
You can specify a specific file, a directory which contains one or
|
||||
more files, or the special word
|
||||
.Em all
|
||||
which says to use all the standard databases.
|
||||
Any of these may be preceded by a percentage, which is a number
|
||||
.Ar N
|
||||
between 0 and 100 inclusive, followed by a
|
||||
.Ar % .
|
||||
If it is, there will be a
|
||||
.Ar N
|
||||
percent probability that an adage will be picked from that file
|
||||
or directory.
|
||||
If the percentages do not sum to 100, and there are specifications
|
||||
without percentages, the remaining percent will apply to those files
|
||||
and/or directories, in which case the probability of selecting from
|
||||
one of them will be based on their relative sizes.
|
||||
.Pp
|
||||
As an example, given two databases
|
||||
.Em funny
|
||||
and
|
||||
.Em not-funny ,
|
||||
with
|
||||
.Em funny
|
||||
twice as big, saying
|
||||
.Bd -literal -offset indent
|
||||
fortune funny not-funny
|
||||
.Ed
|
||||
.Pp
|
||||
will get you fortunes out of
|
||||
.Em funny
|
||||
two-thirds of the time.
|
||||
The command
|
||||
.Bd -literal -offset indent
|
||||
fortune 90% funny 10% not-funny
|
||||
.Ed
|
||||
.Pp
|
||||
will pick out 90% of its fortunes from
|
||||
.Em funny
|
||||
(the ``10% not-funny'' is unnecessary, since 10% is all that's left).
|
||||
The
|
||||
.Fl e
|
||||
option says to consider all files equal; thus
|
||||
.Bd -literal -offset indent
|
||||
fortune -e
|
||||
.Ed
|
||||
.Pp
|
||||
is equivalent to
|
||||
.Bd -literal -offset indent
|
||||
fortune 50% funny 50% not
|
||||
.Em -funny
|
||||
.Ed
|
||||
.Sh FILES
|
||||
.Bl -tag -width Pa -compact
|
||||
.It Pa @sharedir@/fortunes
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr regex 3
|
||||
1424
fortune/fortune/fortune.c
Normal file
1424
fortune/fortune/fortune.c
Normal file
File diff suppressed because it is too large
Load Diff
147
fortune/strfile/strfile.8
Normal file
147
fortune/strfile/strfile.8
Normal file
@@ -0,0 +1,147 @@
|
||||
.\" $NetBSD: strfile.8,v 1.10 2002/09/26 18:32:01 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1989, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" Ken Arnold.
|
||||
.\"
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" @(#)strfile.8 8.1 (Berkeley) 6/9/93
|
||||
.\"
|
||||
.Dd June 9, 1993
|
||||
.Dt STRFILE 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm strfile ,
|
||||
.Nm unstr
|
||||
.Nd "create a random access file for storing strings"
|
||||
.Sh SYNOPSIS
|
||||
.Nm strfile
|
||||
.Op Fl iorsx
|
||||
.Op Fl c Ar char
|
||||
.Ar source_file
|
||||
.Op Ar output_file
|
||||
.Nm unstr
|
||||
.Ar source_file
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
reads a file containing groups of lines separated by a line containing
|
||||
a single percent
|
||||
.Ql \&%
|
||||
sign and creates a data file which contains
|
||||
a header structure and a table of file offsets for each group of lines.
|
||||
This allows random access of the strings.
|
||||
.Pp
|
||||
The output file, if not specified on the command line, is named
|
||||
.Ar source_file Ns Sy .out .
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width "-c char"
|
||||
.It Fl c Ar char
|
||||
Change the delimiting character from the percent sign to
|
||||
.Ar char .
|
||||
.It Fl i
|
||||
Ignore case when ordering the strings.
|
||||
.It Fl o
|
||||
Order the strings in alphabetical order.
|
||||
The offset table will be sorted in the alphabetical order of the
|
||||
groups of lines referenced.
|
||||
Any initial non-alphanumeric characters are ignored.
|
||||
This option causes the
|
||||
.Dv STR_ORDERED
|
||||
bit in the header
|
||||
.Ar str_flags
|
||||
field to be set.
|
||||
.It Fl r
|
||||
Randomize access to the strings.
|
||||
Entries in the offset table will be randomly ordered.
|
||||
This option causes the
|
||||
.Dv STR_RANDOM
|
||||
bit in the header
|
||||
.Ar str_flags
|
||||
field to be set.
|
||||
.It Fl s
|
||||
Run silently; don't give a summary message when finished.
|
||||
.It Fl x
|
||||
Note that each alphabetic character in the groups of lines is rotated
|
||||
13 positions in a simple caesar cipher.
|
||||
This option causes the
|
||||
.Dv STR_ROTATED
|
||||
bit in the header
|
||||
.Ar str_flags
|
||||
field to be set.
|
||||
.El
|
||||
.Pp
|
||||
The format of the header is:
|
||||
.Bd -literal
|
||||
#define VERSION 1
|
||||
unsigned long str_version; /* version number */
|
||||
unsigned long str_numstr; /* # of strings in the file */
|
||||
unsigned long str_longlen; /* length of longest string */
|
||||
unsigned long str_shortlen; /* length of shortest string */
|
||||
#define STR_RANDOM 0x1 /* randomized pointers */
|
||||
#define STR_ORDERED 0x2 /* ordered pointers */
|
||||
#define STR_ROTATED 0x4 /* rot-13'd text */
|
||||
unsigned long str_flags; /* bit field for flags */
|
||||
char str_delim; /* delimiting character */
|
||||
.Ed
|
||||
.Pp
|
||||
All fields are written in big-endian byte order.
|
||||
.Pp
|
||||
The purpose of
|
||||
.Nm unstr
|
||||
is to undo the work of
|
||||
.Nm strfile .
|
||||
It prints out the strings contained in the file
|
||||
.Ar source_file
|
||||
in the order that they are listed in the header file
|
||||
.Ar source_file Ns Sy .dat
|
||||
to standard output.
|
||||
It is possible to create sorted versions of input files by using
|
||||
.Fl o
|
||||
when
|
||||
.Nm strfile
|
||||
is run and then using
|
||||
.Nm unstr
|
||||
to dump them out in the table order.
|
||||
.Sh SEE ALSO
|
||||
.Xr byteorder 3 ,
|
||||
.Xr fortune 6
|
||||
.Sh FILES
|
||||
.Bl -tag -width strfile.out -compact
|
||||
.It Pa strfile.out
|
||||
default output file.
|
||||
.El
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm strfile
|
||||
utility first appeared in
|
||||
.Bx 4.4 .
|
||||
9
fortune/unstr/Makefile.bsd
Normal file
9
fortune/unstr/Makefile.bsd
Normal file
@@ -0,0 +1,9 @@
|
||||
# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:40 lukem Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
NOMAN= # defined
|
||||
|
||||
PROG= unstr
|
||||
CPPFLAGS+= -I${.CURDIR}/../strfile
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
638
hunt/hunt/playit.c
Normal file
638
hunt/hunt/playit.c
Normal file
@@ -0,0 +1,638 @@
|
||||
/* $NetBSD: playit.c,v 1.6 2003/02/26 07:14:44 jdc Exp $ */
|
||||
/*
|
||||
* Hunt
|
||||
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
|
||||
* San Francisco, California
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: playit.c,v 1.6 2003/02/26 07:14:44 jdc Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <sys/file.h>
|
||||
# include <sys/poll.h>
|
||||
# include <err.h>
|
||||
# include <errno.h>
|
||||
# include <curses.h>
|
||||
# include <ctype.h>
|
||||
# include <signal.h>
|
||||
# include <sys/time.h>
|
||||
# if defined(HPUX) || (defined(BSD_RELEASE) && BSD_RELEASE >= 44)
|
||||
# include <termios.h>
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
# include "hunt.h"
|
||||
|
||||
# ifndef FREAD
|
||||
# define FREAD 1
|
||||
# endif
|
||||
|
||||
# if !defined(USE_CURSES) || !defined(TERMINFO)
|
||||
# define beep() (void) putchar(CTRL('G'))
|
||||
# endif
|
||||
# if !defined(USE_CURSES)
|
||||
# undef refresh
|
||||
# define refresh() (void) fflush(stdout);
|
||||
# endif
|
||||
# ifdef USE_CURSES
|
||||
# define clear_eol() clrtoeol()
|
||||
# define put_ch addch
|
||||
# define put_str addstr
|
||||
# endif
|
||||
|
||||
static int nchar_send;
|
||||
# ifndef USE_CURSES
|
||||
char screen[SCREEN_HEIGHT][SCREEN_WIDTH2], blanks[SCREEN_WIDTH];
|
||||
int cur_row, cur_col;
|
||||
# endif
|
||||
# ifdef OTTO
|
||||
int Otto_count;
|
||||
int Otto_mode;
|
||||
static int otto_y, otto_x;
|
||||
static char otto_face;
|
||||
# endif
|
||||
|
||||
# define MAX_SEND 5
|
||||
# define STDIN 0
|
||||
|
||||
/*
|
||||
* ibuf is the input buffer used for the stream from the driver.
|
||||
* It is small because we do not check for user input when there
|
||||
* are characters in the input buffer.
|
||||
*/
|
||||
static int icnt = 0;
|
||||
static unsigned char ibuf[256], *iptr = ibuf;
|
||||
|
||||
#define GETCHR() (--icnt < 0 ? getchr() : *iptr++)
|
||||
|
||||
#if !defined(BSD_RELEASE) || BSD_RELEASE < 44
|
||||
extern int _putchar();
|
||||
#endif
|
||||
|
||||
static unsigned char getchr __P((void));
|
||||
static void send_stuff __P((void));
|
||||
|
||||
/*
|
||||
* playit:
|
||||
* Play a given game, handling all the curses commands from
|
||||
* the driver.
|
||||
*/
|
||||
void
|
||||
playit()
|
||||
{
|
||||
int ch;
|
||||
int y, x;
|
||||
u_int32_t version;
|
||||
|
||||
if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) {
|
||||
bad_con();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (ntohl(version) != (unsigned long)HUNT_VERSION) {
|
||||
bad_ver();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
errno = 0;
|
||||
# ifdef OTTO
|
||||
Otto_count = 0;
|
||||
# endif
|
||||
nchar_send = MAX_SEND;
|
||||
while ((ch = GETCHR()) != EOF) {
|
||||
# ifdef DEBUG
|
||||
fputc(ch, stderr);
|
||||
# endif
|
||||
switch (ch & 0377) {
|
||||
case MOVE:
|
||||
y = GETCHR();
|
||||
x = GETCHR();
|
||||
# ifdef USE_CURSES
|
||||
move(y, x);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, y, x);
|
||||
cur_row = y;
|
||||
cur_col = x;
|
||||
# endif
|
||||
break;
|
||||
case ADDCH:
|
||||
ch = GETCHR();
|
||||
# ifdef OTTO
|
||||
switch (ch) {
|
||||
|
||||
case '<':
|
||||
case '>':
|
||||
case '^':
|
||||
case 'v':
|
||||
otto_face = ch;
|
||||
# ifdef USE_CURSES
|
||||
getyx(stdscr, otto_y, otto_x);
|
||||
# else
|
||||
otto_y = cur_row;
|
||||
otto_x = cur_col;
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
# endif
|
||||
put_ch(ch);
|
||||
break;
|
||||
case CLRTOEOL:
|
||||
clear_eol();
|
||||
break;
|
||||
case CLEAR:
|
||||
clear_the_screen();
|
||||
break;
|
||||
case REFRESH:
|
||||
refresh();
|
||||
break;
|
||||
case REDRAW:
|
||||
redraw_screen();
|
||||
refresh();
|
||||
break;
|
||||
case ENDWIN:
|
||||
refresh();
|
||||
if ((ch = GETCHR()) == LAST_PLAYER)
|
||||
Last_player = TRUE;
|
||||
ch = EOF;
|
||||
goto out;
|
||||
case BELL:
|
||||
beep();
|
||||
break;
|
||||
case READY:
|
||||
refresh();
|
||||
if (nchar_send < 0)
|
||||
# if defined(HPUX) || (defined(BSD_RELEASE) && BSD_RELEASE >= 44)
|
||||
tcflush(STDIN, TCIFLUSH);
|
||||
# else
|
||||
# ifndef TCFLSH
|
||||
(void) ioctl(STDIN, TIOCFLUSH, &in);
|
||||
# else
|
||||
(void) ioctl(STDIN, TCFLSH, 0);
|
||||
# endif
|
||||
# endif
|
||||
nchar_send = MAX_SEND;
|
||||
# ifndef OTTO
|
||||
(void) GETCHR();
|
||||
# else
|
||||
Otto_count -= (GETCHR() & 0xff);
|
||||
if (!Am_monitor) {
|
||||
# ifdef DEBUG
|
||||
fputc('0' + Otto_count, stderr);
|
||||
# endif
|
||||
if (Otto_count == 0 && Otto_mode)
|
||||
otto(otto_y, otto_x, otto_face);
|
||||
}
|
||||
# endif
|
||||
break;
|
||||
default:
|
||||
# ifdef OTTO
|
||||
switch (ch) {
|
||||
|
||||
case '<':
|
||||
case '>':
|
||||
case '^':
|
||||
case 'v':
|
||||
otto_face = ch;
|
||||
# ifdef USE_CURSES
|
||||
getyx(stdscr, otto_y, otto_x);
|
||||
# else
|
||||
otto_y = cur_row;
|
||||
otto_x = cur_col;
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
# endif
|
||||
put_ch(ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
out:
|
||||
(void) close(Socket);
|
||||
}
|
||||
|
||||
/*
|
||||
* getchr:
|
||||
* Grab input and pass it along to the driver
|
||||
* Return any characters from the driver
|
||||
* When this routine is called by GETCHR, we already know there are
|
||||
* no characters in the input buffer.
|
||||
*/
|
||||
static unsigned char
|
||||
getchr()
|
||||
{
|
||||
struct pollfd set[2];
|
||||
int nfds;
|
||||
|
||||
set[0].fd = Socket;
|
||||
set[0].events = POLLIN;
|
||||
set[1].fd = STDIN;
|
||||
set[1].events = POLLIN;
|
||||
|
||||
one_more_time:
|
||||
do {
|
||||
errno = 0;
|
||||
nfds = poll(set, 2, INFTIM);
|
||||
} while (nfds <= 0 && errno == EINTR);
|
||||
|
||||
if (set[1].revents && POLLIN)
|
||||
send_stuff();
|
||||
if (! (set[0].revents & POLLIN))
|
||||
goto one_more_time;
|
||||
icnt = read(Socket, ibuf, sizeof ibuf);
|
||||
if (icnt < 0) {
|
||||
bad_con();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (icnt == 0)
|
||||
goto one_more_time;
|
||||
iptr = ibuf;
|
||||
icnt--;
|
||||
return *iptr++;
|
||||
}
|
||||
|
||||
/*
|
||||
* send_stuff:
|
||||
* Send standard input characters to the driver
|
||||
*/
|
||||
static void
|
||||
send_stuff()
|
||||
{
|
||||
int count;
|
||||
char *sp, *nsp;
|
||||
static char inp[sizeof Buf];
|
||||
|
||||
count = read(STDIN, Buf, sizeof Buf);
|
||||
if (count <= 0)
|
||||
return;
|
||||
if (nchar_send <= 0 && !no_beep) {
|
||||
(void) write(1, "\7", 1); /* CTRL('G') */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* look for 'q'uit commands; if we find one,
|
||||
* confirm it. If it is not confirmed, strip
|
||||
* it out of the input
|
||||
*/
|
||||
Buf[count] = '\0';
|
||||
nsp = inp;
|
||||
for (sp = Buf; *sp != '\0'; sp++)
|
||||
if ((*nsp = map_key[(int)*sp]) == 'q')
|
||||
intr(0);
|
||||
else
|
||||
nsp++;
|
||||
count = nsp - inp;
|
||||
if (count) {
|
||||
# ifdef OTTO
|
||||
Otto_count += count;
|
||||
# endif
|
||||
nchar_send -= count;
|
||||
if (nchar_send < 0)
|
||||
count += nchar_send;
|
||||
(void) write(Socket, inp, count);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* quit:
|
||||
* Handle the end of the game when the player dies
|
||||
*/
|
||||
int
|
||||
quit(old_status)
|
||||
int old_status;
|
||||
{
|
||||
int explain, ch;
|
||||
|
||||
if (Last_player)
|
||||
return Q_QUIT;
|
||||
# ifdef OTTO
|
||||
if (Otto_mode)
|
||||
return Q_CLOAK;
|
||||
# endif
|
||||
# ifdef USE_CURSES
|
||||
move(HEIGHT, 0);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, HEIGHT, 0);
|
||||
cur_row = HEIGHT;
|
||||
cur_col = 0;
|
||||
# endif
|
||||
put_str("Re-enter game [ynwo]? ");
|
||||
clear_eol();
|
||||
explain = FALSE;
|
||||
for (;;) {
|
||||
refresh();
|
||||
if (isupper(ch = getchar()))
|
||||
ch = tolower(ch);
|
||||
if (ch == 'y')
|
||||
return old_status;
|
||||
else if (ch == 'o')
|
||||
break;
|
||||
else if (ch == 'n') {
|
||||
# ifndef INTERNET
|
||||
return Q_QUIT;
|
||||
# else
|
||||
# ifdef USE_CURSES
|
||||
move(HEIGHT, 0);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, HEIGHT, 0);
|
||||
cur_row = HEIGHT;
|
||||
cur_col = 0;
|
||||
# endif
|
||||
put_str("Write a parting message [yn]? ");
|
||||
clear_eol();
|
||||
refresh();
|
||||
for (;;) {
|
||||
if (isupper(ch = getchar()))
|
||||
ch = tolower(ch);
|
||||
if (ch == 'y')
|
||||
goto get_message;
|
||||
if (ch == 'n')
|
||||
return Q_QUIT;
|
||||
}
|
||||
# endif
|
||||
}
|
||||
# ifdef INTERNET
|
||||
else if (ch == 'w') {
|
||||
static char buf[WIDTH + WIDTH % 2];
|
||||
char *cp, c;
|
||||
|
||||
get_message:
|
||||
c = ch; /* save how we got here */
|
||||
# ifdef USE_CURSES
|
||||
move(HEIGHT, 0);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, HEIGHT, 0);
|
||||
cur_row = HEIGHT;
|
||||
cur_col = 0;
|
||||
# endif
|
||||
put_str("Message: ");
|
||||
clear_eol();
|
||||
refresh();
|
||||
cp = buf;
|
||||
for (;;) {
|
||||
refresh();
|
||||
if ((ch = getchar()) == '\n' || ch == '\r')
|
||||
break;
|
||||
# if defined(TERMINFO) || BSD_RELEASE >= 44
|
||||
if (ch == erasechar())
|
||||
# else
|
||||
if (ch == _tty.sg_erase)
|
||||
# endif
|
||||
{
|
||||
if (cp > buf) {
|
||||
# ifdef USE_CURSES
|
||||
int y, x;
|
||||
getyx(stdscr, y, x);
|
||||
move(y, x - 1);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, cur_row,
|
||||
cur_col - 1);
|
||||
cur_col -= 1;
|
||||
# endif
|
||||
cp -= 1;
|
||||
clear_eol();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
# if defined(TERMINFO) || BSD_RELEASE >= 44
|
||||
else if (ch == killchar())
|
||||
# else
|
||||
else if (ch == _tty.sg_kill)
|
||||
# endif
|
||||
{
|
||||
# ifdef USE_CURSES
|
||||
int y, x;
|
||||
getyx(stdscr, y, x);
|
||||
move(y, x - (cp - buf));
|
||||
# else
|
||||
mvcur(cur_row, cur_col, cur_row,
|
||||
cur_col - (cp - buf));
|
||||
cur_col -= cp - buf;
|
||||
# endif
|
||||
cp = buf;
|
||||
clear_eol();
|
||||
continue;
|
||||
} else if (!isprint(ch)) {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
put_ch(ch);
|
||||
*cp++ = ch;
|
||||
if (cp + 1 >= buf + sizeof buf)
|
||||
break;
|
||||
}
|
||||
*cp = '\0';
|
||||
Send_message = buf;
|
||||
return (c == 'w') ? old_status : Q_MESSAGE;
|
||||
}
|
||||
# endif
|
||||
beep();
|
||||
if (!explain) {
|
||||
put_str("(Yes, No, Write message, or Options) ");
|
||||
explain = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef USE_CURSES
|
||||
move(HEIGHT, 0);
|
||||
# else
|
||||
mvcur(cur_row, cur_col, HEIGHT, 0);
|
||||
cur_row = HEIGHT;
|
||||
cur_col = 0;
|
||||
# endif
|
||||
# ifdef FLY
|
||||
put_str("Scan, Cloak, Flying, or Quit? ");
|
||||
# else
|
||||
put_str("Scan, Cloak, or Quit? ");
|
||||
# endif
|
||||
clear_eol();
|
||||
refresh();
|
||||
explain = FALSE;
|
||||
for (;;) {
|
||||
if (isupper(ch = getchar()))
|
||||
ch = tolower(ch);
|
||||
if (ch == 's')
|
||||
return Q_SCAN;
|
||||
else if (ch == 'c')
|
||||
return Q_CLOAK;
|
||||
# ifdef FLY
|
||||
else if (ch == 'f')
|
||||
return Q_FLY;
|
||||
# endif
|
||||
else if (ch == 'q')
|
||||
return Q_QUIT;
|
||||
beep();
|
||||
if (!explain) {
|
||||
# ifdef FLY
|
||||
put_str("[SCFQ] ");
|
||||
# else
|
||||
put_str("[SCQ] ");
|
||||
# endif
|
||||
explain = TRUE;
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
# ifndef USE_CURSES
|
||||
void
|
||||
put_ch(ch)
|
||||
char ch;
|
||||
{
|
||||
if (!isprint(ch)) {
|
||||
fprintf(stderr, "r,c,ch: %d,%d,%d", cur_row, cur_col, ch);
|
||||
return;
|
||||
}
|
||||
screen[cur_row][cur_col] = ch;
|
||||
putchar(ch);
|
||||
if (++cur_col >= COLS) {
|
||||
if (!AM || XN)
|
||||
putchar('\n');
|
||||
cur_col = 0;
|
||||
if (++cur_row >= LINES)
|
||||
cur_row = LINES;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
put_str(s)
|
||||
const char *s;
|
||||
{
|
||||
while (*s)
|
||||
put_ch(*s++);
|
||||
}
|
||||
# endif
|
||||
|
||||
void
|
||||
clear_the_screen()
|
||||
{
|
||||
# ifdef USE_CURSES
|
||||
clear();
|
||||
move(0, 0);
|
||||
refresh();
|
||||
# else
|
||||
int i;
|
||||
|
||||
if (blanks[0] == '\0')
|
||||
for (i = 0; i < SCREEN_WIDTH; i++)
|
||||
blanks[i] = ' ';
|
||||
|
||||
if (CL != NULL) {
|
||||
#if !defined(BSD_RELEASE) || BSD_RELEASE < 44
|
||||
tputs(CL, LINES, _putchar);
|
||||
#else
|
||||
tputs(CL, LINES, __cputchar);
|
||||
#endif
|
||||
for (i = 0; i < SCREEN_HEIGHT; i++)
|
||||
memcpy(screen[i], blanks, SCREEN_WIDTH);
|
||||
} else {
|
||||
for (i = 0; i < SCREEN_HEIGHT; i++) {
|
||||
mvcur(cur_row, cur_col, i, 0);
|
||||
cur_row = i;
|
||||
cur_col = 0;
|
||||
clear_eol();
|
||||
}
|
||||
mvcur(cur_row, cur_col, 0, 0);
|
||||
}
|
||||
cur_row = cur_col = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef USE_CURSES
|
||||
void
|
||||
clear_eol()
|
||||
{
|
||||
if (CE != NULL)
|
||||
#if !defined(BSD_RELEASE) || BSD_RELEASE < 44
|
||||
tputs(CE, 1, _putchar);
|
||||
#else
|
||||
tputs(CE, 1, __cputchar);
|
||||
#endif
|
||||
else {
|
||||
fwrite(blanks, sizeof (char), SCREEN_WIDTH - cur_col, stdout);
|
||||
if (COLS != SCREEN_WIDTH)
|
||||
mvcur(cur_row, SCREEN_WIDTH, cur_row, cur_col);
|
||||
else if (AM)
|
||||
mvcur(cur_row + 1, 0, cur_row, cur_col);
|
||||
else
|
||||
mvcur(cur_row, SCREEN_WIDTH - 1, cur_row, cur_col);
|
||||
}
|
||||
memcpy(&screen[cur_row][cur_col], blanks, SCREEN_WIDTH - cur_col);
|
||||
}
|
||||
# endif
|
||||
|
||||
void
|
||||
redraw_screen()
|
||||
{
|
||||
# ifdef USE_CURSES
|
||||
clearok(stdscr, TRUE);
|
||||
touchwin(stdscr);
|
||||
# else
|
||||
int i;
|
||||
# ifndef NOCURSES
|
||||
static int first = 1;
|
||||
|
||||
if (first) {
|
||||
curscr = newwin(SCREEN_HEIGHT, SCREEN_WIDTH, 0, 0);
|
||||
if (curscr == NULL)
|
||||
errx(1, "Can't create curscr");
|
||||
# if !defined(BSD_RELEASE) || BSD_RELEASE < 44
|
||||
for (i = 0; i < SCREEN_HEIGHT; i++)
|
||||
curscr->_y[i] = screen[i];
|
||||
# endif
|
||||
first = 0;
|
||||
}
|
||||
# if defined(BSD_RELEASE) && BSD_RELEASE >= 44
|
||||
for (i = 0; i < SCREEN_HEIGHT; i++) {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < SCREEN_WIDTH; j++)
|
||||
curscr->lines[i]->line[j].ch = screen[i][j];
|
||||
}
|
||||
curscr->cury = cur_row;
|
||||
curscr->curx = cur_col;
|
||||
# else
|
||||
curscr->_cury = cur_row;
|
||||
curscr->_curx = cur_col;
|
||||
# endif
|
||||
clearok(curscr, TRUE);
|
||||
touchwin(curscr);
|
||||
wrefresh(curscr);
|
||||
#else
|
||||
mvcur(cur_row, cur_col, 0, 0);
|
||||
for (i = 0; i < SCREEN_HEIGHT - 1; i++) {
|
||||
fwrite(screen[i], sizeof (char), SCREEN_WIDTH, stdout);
|
||||
if (COLS > SCREEN_WIDTH || (COLS == SCREEN_WIDTH && !AM))
|
||||
putchar('\n');
|
||||
}
|
||||
fwrite(screen[SCREEN_HEIGHT - 1], sizeof (char), SCREEN_WIDTH - 1,
|
||||
stdout);
|
||||
mvcur(SCREEN_HEIGHT - 1, SCREEN_WIDTH - 1, cur_row, cur_col);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* do_message:
|
||||
* Send a message to the driver and return
|
||||
*/
|
||||
void
|
||||
do_message()
|
||||
{
|
||||
u_int32_t version;
|
||||
|
||||
if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) {
|
||||
bad_con();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (ntohl(version) != (unsigned long)HUNT_VERSION) {
|
||||
bad_ver();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
# ifdef INTERNET
|
||||
if (write(Socket, Send_message, strlen(Send_message)) < 0) {
|
||||
bad_con();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
# endif
|
||||
(void) close(Socket);
|
||||
}
|
||||
7
hunt/huntd/.cvsignore
Normal file
7
hunt/huntd/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
huntd
|
||||
huntd.6
|
||||
141
hunt/huntd/get_names.c
Normal file
141
hunt/huntd/get_names.c
Normal file
@@ -0,0 +1,141 @@
|
||||
/* $NetBSD: get_names.c,v 1.6 2001/02/05 00:42:15 christos Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1983 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: get_names.c,v 1.6 2001/02/05 00:42:15 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "bsd.h"
|
||||
|
||||
#if defined(TALK_43) || defined(TALK_42)
|
||||
|
||||
# include <sys/param.h>
|
||||
# include <netdb.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <unistd.h>
|
||||
# include "hunt.h"
|
||||
# include "talk_ctl.h"
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 256
|
||||
#endif
|
||||
|
||||
static char hostname[MAXHOSTNAMELEN + 1];
|
||||
char *my_machine_name;
|
||||
|
||||
/*
|
||||
* Determine the local user and machine
|
||||
*/
|
||||
void
|
||||
get_local_name(my_name)
|
||||
const char *my_name;
|
||||
{
|
||||
struct hostent *hp;
|
||||
struct servent *sp;
|
||||
|
||||
/* Load these useful values into the standard message header */
|
||||
msg.id_num = 0;
|
||||
(void) strncpy(msg.l_name, my_name, NAME_SIZE);
|
||||
msg.l_name[NAME_SIZE - 1] = '\0';
|
||||
msg.r_tty[0] = '\0';
|
||||
msg.pid = getpid();
|
||||
# ifdef TALK_43
|
||||
msg.vers = TALK_VERSION;
|
||||
msg.addr.sa_family = htons(AF_INET);
|
||||
msg.ctl_addr.sa_family = htons(AF_INET);
|
||||
# else
|
||||
msg.addr.sin_family = htons(AF_INET);
|
||||
msg.ctl_addr.sin_family = htons(AF_INET);
|
||||
# endif
|
||||
|
||||
(void)gethostname(hostname, sizeof (hostname));
|
||||
hostname[sizeof(hostname) - 1] = '\0';
|
||||
my_machine_name = hostname;
|
||||
/* look up the address of the local host */
|
||||
hp = gethostbyname(my_machine_name);
|
||||
if (hp == (struct hostent *) 0) {
|
||||
# ifdef LOG
|
||||
syslog(LOG_ERR,
|
||||
"This machine doesn't exist. Boy, am I confused!");
|
||||
# else
|
||||
perror("This machine doesn't exist. Boy, am I confused!");
|
||||
# endif
|
||||
exit(1);
|
||||
}
|
||||
memcpy(&my_machine_addr, hp->h_addr, hp->h_length);
|
||||
/* find the daemon portal */
|
||||
# ifdef TALK_43
|
||||
sp = getservbyname("ntalk", "udp");
|
||||
# else
|
||||
sp = getservbyname("talk", "udp");
|
||||
# endif
|
||||
if (sp == 0) {
|
||||
# ifdef LOG
|
||||
syslog(LOG_ERR, "This machine doesn't support talk");
|
||||
# else
|
||||
perror("This machine doesn't support talk");
|
||||
# endif
|
||||
exit(1);
|
||||
}
|
||||
daemon_port = sp->s_port;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the remote user and machine
|
||||
*/
|
||||
int
|
||||
get_remote_name(his_address)
|
||||
char *his_address;
|
||||
{
|
||||
char *his_name;
|
||||
char *his_machine_name;
|
||||
char *ptr;
|
||||
struct hostent *hp;
|
||||
|
||||
|
||||
/* check for, and strip out, the machine name of the target */
|
||||
for (ptr = his_address; *ptr != '\0' && *ptr != '@' && *ptr != ':'
|
||||
&& *ptr != '!' && *ptr != '.'; ptr++)
|
||||
continue;
|
||||
if (*ptr == '\0') {
|
||||
/* this is a local to local talk */
|
||||
his_name = his_address;
|
||||
his_machine_name = my_machine_name;
|
||||
} else {
|
||||
if (*ptr == '@') {
|
||||
/* user@host */
|
||||
his_name = his_address;
|
||||
his_machine_name = ptr + 1;
|
||||
} else {
|
||||
/* host.user or host!user or host:user */
|
||||
his_name = ptr + 1;
|
||||
his_machine_name = his_address;
|
||||
}
|
||||
*ptr = '\0';
|
||||
}
|
||||
/* Load these useful values into the standard message header */
|
||||
(void) strncpy(msg.r_name, his_name, NAME_SIZE);
|
||||
msg.r_name[NAME_SIZE - 1] = '\0';
|
||||
|
||||
/* if he is on the same machine, then simply copy */
|
||||
if (memcmp((char *) &his_machine_name, (char *) &my_machine_name,
|
||||
sizeof(his_machine_name)) == 0)
|
||||
memcpy(&his_machine_addr, &my_machine_addr,
|
||||
sizeof(his_machine_name));
|
||||
else {
|
||||
/* look up the address of the recipient's machine */
|
||||
hp = gethostbyname(his_machine_name);
|
||||
if (hp == (struct hostent *) 0)
|
||||
return 0; /* unknown host */
|
||||
memcpy(&his_machine_addr, hp->h_addr, hp->h_length);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
50
quiz/datfiles/posneg
Normal file
50
quiz/datfiles/posneg
Normal file
@@ -0,0 +1,50 @@
|
||||
large|big:small
|
||||
on:off
|
||||
standing up:sitting down
|
||||
inside:outside
|
||||
high:low
|
||||
old:new|young
|
||||
hot:cold
|
||||
out:in
|
||||
heavy|dark:light
|
||||
daytime:night[time| time]
|
||||
stop|come:go
|
||||
top:bottom
|
||||
floor:ceiling
|
||||
near:far
|
||||
run:walk
|
||||
empty|hungry:full
|
||||
backwards:f[or|ront]wards
|
||||
big|large:little|small
|
||||
fat|thick:thin|skinny
|
||||
bright|light:dark|dull
|
||||
right:wrong|left
|
||||
give:take|receive|get
|
||||
buy:sell
|
||||
shiny|bright:dull
|
||||
dawn:dusk
|
||||
fall down|go to bed:[get|stand|rise] up
|
||||
asleep:awake
|
||||
up:down
|
||||
open[ed|]:close[d|]
|
||||
smile:frown|cry
|
||||
happy|glad:sad
|
||||
hard:soft|easy
|
||||
boy|woman|lady:girl|man
|
||||
fast:slow
|
||||
wet:dry
|
||||
covered|hid[den|]:uncovered|open
|
||||
good:bad
|
||||
always|sometimes|now:never|sometimes
|
||||
beautiful|pretty:ugly
|
||||
rough:smooth
|
||||
hairy:bald|smooth
|
||||
above:below
|
||||
yin:yang
|
||||
sweet:sour
|
||||
if:unless
|
||||
from|fro:to
|
||||
with[in|]:without|against
|
||||
after:before
|
||||
together:apart
|
||||
plus:minus
|
||||
131
snake/snake/snake.6.in
Normal file
131
snake/snake/snake.6.in
Normal file
@@ -0,0 +1,131 @@
|
||||
.\" $NetBSD: snake.6,v 1.10 2002/09/26 16:12:43 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 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.
|
||||
.\"
|
||||
.\" @(#)snake.6 8.1 (Berkeley) 5/31/93
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt SNAKE 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm snake ,
|
||||
.Nm snscore
|
||||
.Nd display chase game
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl w Ar width
|
||||
.Op Fl l Ar length
|
||||
.Op Fl t
|
||||
.br
|
||||
.Nm snscore
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is a display-based game which must be played on a CRT terminal.
|
||||
The object of the game is to make as much money as possible without
|
||||
getting eaten by the snake.
|
||||
The
|
||||
.Fl l
|
||||
and
|
||||
.Fl w
|
||||
options allow you to specify the length and width of the field.
|
||||
By default the entire screen is used.
|
||||
The
|
||||
.Fl t
|
||||
option makes the game assume you are on a slow terminal.
|
||||
.Pp
|
||||
You are represented on the screen by an I.
|
||||
The snake is 6 squares long and is represented by s's with an S at its head.
|
||||
The money is $, and an exit is #.
|
||||
Your score is posted in the upper left hand corner.
|
||||
.Pp
|
||||
You can move around using the same conventions as
|
||||
.Xr vi 1 ,
|
||||
the
|
||||
.Ic h ,
|
||||
.Ic j ,
|
||||
.Ic k ,
|
||||
and
|
||||
.Ic l
|
||||
keys work, as do the arrow keys.
|
||||
Other possibilities include:
|
||||
.Bl -tag -width indent
|
||||
.It Ic sefc
|
||||
These keys are like hjkl but form a directed pad around the d key.
|
||||
.It Ic HJKL
|
||||
These keys move you all the way in the indicated direction to the
|
||||
same row or column as the money.
|
||||
This does
|
||||
.Em not
|
||||
let you jump away from the snake, but rather saves you from having
|
||||
to type a key repeatedly.
|
||||
The snake still gets all his turns.
|
||||
.It Ic SEFC
|
||||
Likewise for the upper case versions on the left.
|
||||
.It Ic ATPB
|
||||
These keys move you to the four edges of the screen.
|
||||
Their position on the keyboard is the mnemonic, e.g.
|
||||
P is at the far right of the keyboard.
|
||||
.It Ic x
|
||||
This lets you quit the game at any time.
|
||||
.It Ic p
|
||||
Points in a direction you might want to go.
|
||||
.It Ic w
|
||||
Space warp to get out of tight squeezes, at a price.
|
||||
.El
|
||||
.Pp
|
||||
To earn money, move to the same square the money is on.
|
||||
A new $ will appear when you earn the current one.
|
||||
As you get richer, the snake gets hungrier.
|
||||
To leave the game, move to the exit (#).
|
||||
.Pp
|
||||
A record is kept of the personal best score of each player.
|
||||
Scores are only counted if you leave at the exit,
|
||||
getting eaten by the snake is worth nothing.
|
||||
.Pp
|
||||
As in pinball, matching the last digit of your score to the number
|
||||
which appears after the game is worth a bonus.
|
||||
.Pp
|
||||
To see who wastes time playing snake, run
|
||||
.Nm snscore .
|
||||
.Sh FILES
|
||||
.Bl -tag -width @snake_rawscorefile@ -compact
|
||||
.It Pa @snake_rawscorefile@
|
||||
database of personal bests
|
||||
.It Pa @snake_scorefile@
|
||||
log of games played
|
||||
.El
|
||||
.Sh BUGS
|
||||
When playing on a small screen,
|
||||
it's hard to tell when you hit the edge of the screen.
|
||||
.Pp
|
||||
The scoring function takes into account the size of the screen.
|
||||
A perfect function to do this equitably has not been devised.
|
||||
6
snake/snscore/.cvsignore
Normal file
6
snake/snscore/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
snscore
|
||||
Reference in New Issue
Block a user