Classic "drop tokens" game.

PR:		3625
Submitted by:	Joel Sutton sutton@aardvark.apana.org.au
This commit is contained in:
Satoshi Asami 1997-06-04 03:21:13 +00:00
parent 97b19190ea
commit 61bc540838
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=6730
9 changed files with 190 additions and 0 deletions

35
games/connect4/Makefile Normal file
View file

@ -0,0 +1,35 @@
# New ports collection makefile for: connect4
# Version required: 3.2
# Date created: Thu May 8 16:41:01 EST 1997
# Whom: Joel Sutton <sutton@aardvark.apana.org.au>
# FreeBSD Version: 2.1.5-RELEASE
#
# $Id$
#
DISTNAME= connect4
PKGNAME= connect4-3.2
CATEGORIES= games
MASTER_SITES= ftp://ftp.gu.kiev.ua/pub/cdrom5/games/volume6/ \
ftp://scitsc.wlv.ac.uk/pub/infomagic/usenet/games/volume6/
EXTRACT_SUFX= ""
MAINTAINER= sutton@aardvark.apana.org.au
BUILD_DEPENDS= gunshar:${PORTSDIR}/archivers/gshar+gunshar
EXTRACT_CMD= gunshar
EXTRACT_BEFORE_ARGS= ""
NO_WRKSUBDIR= yes
MAN6= connect4.6
MANDIR= ${PREFIX}/man/man
LIBDIR= ${PREFIX}/lib
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/c4 ${PREFIX}/bin/connect4
${MKDIR} ${LIBDIR}/connect4
${INSTALL_DATA} -m 666 /dev/null ${LIBDIR}/connect4/scores
${INSTALL_MAN} ${FILESDIR}/connect4.6 ${MANDIR}6/
.include <bsd.port.mk>

1
games/connect4/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (connect4) = d09ae9fc10591b6c0f021f38c129d90f

View file

@ -0,0 +1,46 @@
.TH connect4 6 "8th May, 1997" "Version 3.2"
.SH NAME
\fBconnect4\fP - a game of placement
.SH SYNOPSIS
.IP "connect4" 10
\fB[ -Shv12 ]\fP
.LP
.SH DESCRIPTION
\fBconnect4(6)\fP is a simple game where you must line up four tokens
in a row.
.SH OPTIONS
.IP "\fB-S\fP"
Display high scores
.IP "\fB-h\fP"
Help on command line switches
.IP "\fB-v\fP"
Display version number
.IP "\fB-1\fP"
Player has first move
.IP "\fB-2\fP"
Computer has first move
.SH NOTES
.LP
The real-life version of connect4 is basically an upright hollow board
with several vertical columns and windows. Tokens are placed into the
columns alternately by each player until one of the players has four
tokens in a row. These four tokens must be adjacent to each other but
the series of four can be in any direction.
.sp
Tokens are placed into a column by typing the number of the column
printed at the top of the screen.
.sp
To exit the game type \fBq\fP or \fBx\fP and \fBctrl-L\fP redraws the screen.
.SH BUGS
There are bound to be bugs in this program. Use at your own risk as no
guarantee will be made that this software will not break your system
in any way.
.SH AUTHORS
connect4 came from comp.sources.games Volume 6, Issue 51
.br
Submitted by Terry Jones <tcjones@watdragon.waterloo.edu> April,
1989
.sp
Man page by Joel Sutton <sutton@aardvark.apana.org.au>
.SH COPYRIGHT
Connect Four is undoubtedly a trade mark or some such of Milton Bradley.

View file

@ -0,0 +1,24 @@
*** Makefile.orig Tue Apr 15 21:55:19 1997
--- Makefile Tue Apr 15 21:57:58 1997
***************
*** 1,7 ****
# Makefile for c4
! CFLAGS = -g #-DSCOREFILE=\"/usr/games/lib/c4.scores\"
CURSES = -lcurses -ltermcap
c4 : c4.o screen.o c4.h tables.h types.h
cc $(CFLAGS) -o c4 c4.o screen.o $(CURSES)
--- 1,12 ----
# Makefile for c4
+ # Patched for FreeBSD 2.1.5R by
+ # Joel Sutton <suttonj@interconnect.com.au>
+ # 15th April, 1997
! CFLAGS = -O -g -DSCOREFILE=\"/usr/local/lib/connect4/scores\"
CURSES = -lcurses -ltermcap
+
+ all: c4
c4 : c4.o screen.o c4.h tables.h types.h
cc $(CFLAGS) -o c4 c4.o screen.o $(CURSES)

View file

@ -0,0 +1,49 @@
*** c4.c.orig Tue Apr 15 22:06:03 1997
--- c4.c Tue Apr 15 22:16:29 1997
***************
*** 11,16 ****
--- 11,18 ----
* BITNET: tcjones@WATER.bitnet
* Canadian domain: tcjones@dragon.uwaterloo.ca
*
+ * Patched by Joel Sutton, 15th April 1997
+ * Changed gets calls to fgets. Changed inital prompt slightly.
*/
#include <stdio.h>
***************
*** 219,225 ****
register char *cp;
printf("Would you like to go first? (yes/no) -> ");
! if (!gets(line)){
plot_finish();
fprintf(stderr, "Could not read input line.\n");
goodbye();
--- 221,227 ----
register char *cp;
printf("Would you like to go first? (yes/no) -> ");
! if (!fgets(line,256,stdin)){
plot_finish();
fprintf(stderr, "Could not read input line.\n");
goodbye();
***************
*** 620,627 ****
}
}
! printf("Do you need help (n/y)? -> ");
! if (!gets(line)){
fprintf(stderr, "Could not read input line\n");
goodbye();
}
--- 622,629 ----
}
}
! printf("Do you need help (y/n)? -> ");
! if (!fgets(line,256,stdin)){
fprintf(stderr, "Could not read input line\n");
goodbye();
}

View file

@ -0,0 +1,23 @@
*** screen.c.orig Tue Apr 15 22:06:03 1997
--- screen.c Tue Apr 15 22:16:30 1997
***************
*** 1,3 ****
--- 1,8 ----
+ /*
+ * Patched by Joel Sutton, 15th April 1997
+ * Added endwin to tidy things up as per usenet posted patch.
+ */
+
#include <stdio.h>
#include <curses.h>
#include "c4.h"
***************
*** 116,121 ****
--- 121,127 ----
refresh();
nocrmode();
echo();
+ endwin();
}

View file

@ -0,0 +1 @@
A curses version of the classic game.

8
games/connect4/pkg-descr Normal file
View file

@ -0,0 +1,8 @@
Please refer to the man page for instructions and further information.
This version contains my patches and man page.
Share and enjoy,
Joel...
sutton@aardvark.apana.org.au

3
games/connect4/pkg-plist Normal file
View file

@ -0,0 +1,3 @@
bin/connect4
man/man6/connect4.6.gz
lib/connect4/scores