connect4 port

This commit is contained in:
angelos 1998-05-20 03:04:07 +00:00
parent 243dff0fe9
commit d9deb28d8f
9 changed files with 189 additions and 0 deletions

34
games/connect4/Makefile Normal file
View File

@ -0,0 +1,34 @@
# OpenBSD makefile for: connect4
# Version required: 3.2
# Date created: May 19 1998
# Whom: Angelos D. Keromytis
#
# $OpenBSD: Makefile,v 1.1.1.1 1998/05/20 03:04:07 angelos Exp $
#
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= angelos@openbsd.org
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>

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.

1
games/connect4/files/md5 Normal file
View File

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

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
lib/connect4/scores