mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
copy in from cvs; cvs2svn fucked up big time
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,4 +1,30 @@
|
||||
# Makefrag - makefile fragment for mille
|
||||
#
|
||||
# Copyright (c) 1997, 1998 Joseph Samuel Myers.
|
||||
# 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. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
|
||||
mille_DIRS := $(GAMESDIR) $(MAN6DIR)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $ */
|
||||
/* $NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $");
|
||||
__RCSID("$NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $ */
|
||||
/* $NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $");
|
||||
__RCSID("$NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $ */
|
||||
/* $NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $");
|
||||
__RCSID("$NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: mille.6,v 1.6 1997/10/12 00:54:03 lukem Exp $
|
||||
.\" $NetBSD: mille.6,v 1.8 2002/09/26 16:12:41 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1983, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -57,12 +57,14 @@ This card is placed in the `P' slot in your hand.
|
||||
.IP D
|
||||
Discard a card from your hand.
|
||||
To indicate which card, type the number of the card in the hand
|
||||
(or \*(lqP\*(rq for the just-picked card) followed by a <RETURN> or <SPACE>.
|
||||
The <RETURN or <SPACE> is required to allow recovery from typos
|
||||
(or \*(lqP\*(rq for the just-picked card) followed
|
||||
by a \*[Lt]RETURN\*[Gt] or \*[Lt]SPACE\*[Gt].
|
||||
The \*[Lt]RETURN or \*[Lt]SPACE\*[Gt] is required to allow recovery from typos
|
||||
which can be very expensive, like discarding safeties.
|
||||
.IP U
|
||||
Use a card.
|
||||
The card is again indicated by its number, followed by a <RETURN> or <SPACE>.
|
||||
The card is again indicated by its number,
|
||||
followed by a \*[Lt]RETURN\*[Gt] or \*[Lt]SPACE\*[Gt].
|
||||
.IP O
|
||||
Toggle ordering the hand.
|
||||
By default off, if turned on it will sort the cards in your hand appropriately.
|
||||
@@ -70,14 +72,14 @@ This is not recommended for the impatient on slow terminals.
|
||||
.IP Q
|
||||
Quit the game.
|
||||
This will ask for confirmation, just to be sure.
|
||||
Hitting <DELETE> (or <RUBOUT>) is equivalent.
|
||||
Hitting \*[Lt]DELETE\*[Gt] (or \*[Lt]RUBOUT\*[Gt]) is equivalent.
|
||||
.IP S
|
||||
Save the game in a file.
|
||||
If the game was started from a file,
|
||||
you will be given an opportunity to save it on the same file.
|
||||
If you don't wish to, or you did not start from a file,
|
||||
you will be asked for the file name.
|
||||
If you type a <RETURN> without a name,
|
||||
If you type a \*[Lt]RETURN\*[Gt] without a name,
|
||||
the save will be terminated and the game resumed.
|
||||
.IP R
|
||||
Redraw the screen from scratch.
|
||||
@@ -193,9 +195,11 @@ All the Hazard and Remedy Cards are played here, except the
|
||||
.I "Speed Limit"
|
||||
and
|
||||
.I "End of Limit"
|
||||
cards. Only the top card is displayed, as it is the only effective one.
|
||||
cards.
|
||||
Only the top card is displayed, as it is the only effective one.
|
||||
.BR SPEED :
|
||||
The Speed pile. The
|
||||
The Speed pile.
|
||||
The
|
||||
.I "Speed Limit"
|
||||
and
|
||||
.I "End of Limit"
|
||||
@@ -209,8 +213,9 @@ The total of the numbers shown here is the distance traveled so far.
|
||||
The first pick alternates between the two players.
|
||||
Each turn usually starts with a pick from the deck.
|
||||
The player then plays a card, or if this is not possible or desirable,
|
||||
discards one. Normally, a play or discard of a single card
|
||||
constitutes a turn. If the card played is a safety, however,
|
||||
discards one.
|
||||
Normally, a play or discard of a single card constitutes a turn.
|
||||
If the card played is a safety, however,
|
||||
the same player takes another turn immediately.
|
||||
.PP
|
||||
This repeats until one of the players reaches 700 points or the deck runs out.
|
||||
@@ -252,7 +257,8 @@ played by your opponent.
|
||||
.RB "\ \ \ \ " "Out of Gas"
|
||||
is played on your opponent's
|
||||
.I Go
|
||||
card. They must then play a
|
||||
card.
|
||||
They must then play a
|
||||
.I Gasoline
|
||||
card, and then a
|
||||
.I Go
|
||||
@@ -261,7 +267,8 @@ card before they can play any more mileage.
|
||||
.RB "\ \ \ \ " "Flat Tire"
|
||||
is played on your opponent's
|
||||
.I Go
|
||||
card. They must then play a
|
||||
card.
|
||||
They must then play a
|
||||
.I "Spare Tire"
|
||||
card, and then a
|
||||
.I Go
|
||||
@@ -271,7 +278,8 @@ card before they can play any more mileage.
|
||||
.RB "\ \ \ \ " "Accident"
|
||||
is played on your opponent's
|
||||
.I Go
|
||||
card. They must then play a
|
||||
card.
|
||||
They must then play a
|
||||
.I Repairs
|
||||
card, and then a
|
||||
.I Go
|
||||
@@ -289,7 +297,8 @@ prevents your opponent from playing both
|
||||
.I Stop
|
||||
and
|
||||
.I "Speed Limit"
|
||||
cards on you. It also acts as a permanent
|
||||
cards on you.
|
||||
It also acts as a permanent
|
||||
.I Go
|
||||
card for the rest of the hand, so you can play mileage
|
||||
as long as there is not a Hazard card on top of your Battle pile.
|
||||
@@ -334,9 +343,10 @@ If an opponent plays a Hazard card,
|
||||
and you have the corresponding Safety in your hand,
|
||||
you play it immediately, even
|
||||
.I before
|
||||
you draw. This immediately removes the Hazard card from your Battle pile,
|
||||
and protects you from that card for the rest of the game. This
|
||||
gives you more points (see \*(lqScoring\*(rq below).
|
||||
you draw.
|
||||
This immediately removes the Hazard card from your Battle pile,
|
||||
and protects you from that card for the rest of the game.
|
||||
This gives you more points (see \*(lqScoring\*(rq below).
|
||||
.PP
|
||||
.BR Scoring :
|
||||
Scores are totaled at the end of each hand,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mille.c,v 1.6 1997/10/12 00:54:07 lukem Exp $ */
|
||||
/* $NetBSD: mille.c,v 1.12 2001/12/06 12:12:34 blymn Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -43,15 +43,12 @@ __COPYRIGHT("@(#) Copyright (c) 1982, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mille.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: mille.c,v 1.6 1997/10/12 00:54:07 lukem Exp $");
|
||||
__RCSID("$NetBSD: mille.c,v 1.12 2001/12/06 12:12:34 blymn Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
# include "mille.h"
|
||||
# include <signal.h>
|
||||
# ifdef attron
|
||||
# include <term.h>
|
||||
# endif attron
|
||||
|
||||
/*
|
||||
* @(#)mille.c 1.3 (Berkeley) 5/10/83
|
||||
@@ -81,7 +78,7 @@ main(ac, av)
|
||||
break;
|
||||
default:
|
||||
printf("usage: milles [ restore_file ]\n");
|
||||
exit(-1);
|
||||
exit(1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
Play = PLAYER;
|
||||
@@ -103,7 +100,7 @@ main(ac, av)
|
||||
# else
|
||||
srandom(0);
|
||||
# endif
|
||||
crmode();
|
||||
cbreak();
|
||||
noecho();
|
||||
signal(SIGINT, rub);
|
||||
for (;;) {
|
||||
@@ -146,7 +143,7 @@ main(ac, av)
|
||||
*/
|
||||
void
|
||||
rub(dummy)
|
||||
int dummy __attribute__((unused));
|
||||
int dummy __attribute__((__unused__));
|
||||
{
|
||||
(void)signal(SIGINT, SIG_IGN);
|
||||
if (getyn(REALLYPROMPT))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mille.h,v 1.9 1998/09/13 15:27:29 hubertf Exp $ */
|
||||
/* $NetBSD: mille.h,v 1.11 1999/09/30 18:01:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
|
||||
26
mille/misc.c
26
mille/misc.c
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: misc.c,v 1.7 1998/07/26 16:11:40 mycroft Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.10 2002/05/26 00:12:13 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -38,18 +38,14 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: misc.c,v 1.7 1998/07/26 16:11:40 mycroft Exp $");
|
||||
__RCSID("$NetBSD: misc.c,v 1.10 2002/05/26 00:12:13 wiz Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <termios.h>
|
||||
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "mille.h"
|
||||
#ifndef unctrl
|
||||
@@ -57,10 +53,6 @@ __RCSID("$NetBSD: misc.c,v 1.7 1998/07/26 16:11:40 mycroft Exp $");
|
||||
#endif
|
||||
|
||||
|
||||
# ifdef attron
|
||||
# include <term.h>
|
||||
# endif attron
|
||||
|
||||
/*
|
||||
* @(#)misc.c 1.2 (Berkeley) 3/28/83
|
||||
*/
|
||||
@@ -68,24 +60,14 @@ __RCSID("$NetBSD: misc.c,v 1.7 1998/07/26 16:11:40 mycroft Exp $");
|
||||
#define NUMSAFE 4
|
||||
|
||||
bool
|
||||
#if __STDC__
|
||||
error(const char *str, ...)
|
||||
#else
|
||||
error(str, va_alist)
|
||||
const char *str;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
#if __STDC__
|
||||
va_start(ap, str);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
wmove(Score, ERR_Y, ERR_X);
|
||||
vwprintw(Score, str, ap);
|
||||
clrtoeol();
|
||||
wclrtoeol(Score);
|
||||
putchar('\07');
|
||||
refresh();
|
||||
va_end(ap);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: move.c,v 1.7 1997/10/12 00:54:21 lukem Exp $ */
|
||||
/* $NetBSD: move.c,v 1.12 1999/10/01 17:06:01 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: move.c,v 1.7 1997/10/12 00:54:21 lukem Exp $");
|
||||
__RCSID("$NetBSD: move.c,v 1.12 1999/10/01 17:06:01 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -49,10 +49,6 @@ __RCSID("$NetBSD: move.c,v 1.7 1997/10/12 00:54:21 lukem Exp $");
|
||||
#include "unctrl.h"
|
||||
#endif
|
||||
|
||||
# ifdef attron
|
||||
# include <term.h>
|
||||
# endif attron
|
||||
|
||||
/*
|
||||
* @(#)move.c 1.2 (Berkeley) 3/28/83
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: print.c,v 1.6 1997/10/12 00:54:24 lukem Exp $ */
|
||||
/* $NetBSD: print.c,v 1.10 2000/04/27 17:49:15 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.6 1997/10/12 00:54:24 lukem Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.10 2000/04/27 17:49:15 thorpej Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -89,7 +89,7 @@ prboard()
|
||||
pp = &Player[PLAYER];
|
||||
for (i = 0; i < HAND_SZ; i++)
|
||||
show_card(i + 6, temp, pp->hand[i], &pp->sh_hand[i]);
|
||||
mvprintw(6, COMP_STRT + CARD_STRT, "%2d", Topcard - Deck);
|
||||
mvprintw(6, COMP_STRT + CARD_STRT, "%2ld", (long)(Topcard - Deck));
|
||||
show_card(8, COMP_STRT + CARD_STRT, Discard, &Sh_discard);
|
||||
if (End == 1000) {
|
||||
move(EXT_Y, EXT_X);
|
||||
@@ -122,7 +122,11 @@ static char Score_fmt[] = "%4d";
|
||||
|
||||
void
|
||||
prscore(for_real)
|
||||
bool for_real;
|
||||
#ifdef EXTRAP
|
||||
bool for_real;
|
||||
#else
|
||||
bool for_real __attribute__((__unused__));
|
||||
#endif
|
||||
{
|
||||
PLAY *pp;
|
||||
int x;
|
||||
|
||||
14
mille/save.c
14
mille/save.c
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: save.c,v 1.6 1997/10/12 00:54:32 lukem Exp $ */
|
||||
/* $NetBSD: save.c,v 1.10 1999/09/09 17:30:20 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -38,22 +38,18 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: save.c,v 1.6 1997/10/12 00:54:32 lukem Exp $");
|
||||
__RCSID("$NetBSD: save.c,v 1.10 1999/09/09 17:30:20 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "mille.h"
|
||||
|
||||
#ifndef unctrl
|
||||
#include "unctrl.h"
|
||||
#endif
|
||||
|
||||
# ifdef attron
|
||||
# include <term.h>
|
||||
# endif attron
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/*
|
||||
* @(#)save.c 1.2 (Berkeley) 3/28/83
|
||||
*/
|
||||
@@ -85,7 +81,7 @@ over:
|
||||
leaveok(Board, FALSE);
|
||||
refresh();
|
||||
sp = buf;
|
||||
while ((*sp = readch()) != '\n') {
|
||||
while ((*sp = readch()) != '\n' && *sp != '\r') {
|
||||
if (*sp == killchar())
|
||||
goto over;
|
||||
else if (*sp == erasechar()) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $ */
|
||||
/* $NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)types.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $");
|
||||
__RCSID("$NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user