summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
Diffstat (limited to 'games')
-rw-r--r--games/knightcap-brain/Makefile31
-rw-r--r--games/knightcap-brain/files/md53
-rw-r--r--games/knightcap-brain/files/newbrain.sh33
-rw-r--r--games/knightcap-brain/pkg/COMMENT1
-rw-r--r--games/knightcap-brain/pkg/DESCR3
-rw-r--r--games/knightcap-brain/pkg/PLIST4
6 files changed, 75 insertions, 0 deletions
diff --git a/games/knightcap-brain/Makefile b/games/knightcap-brain/Makefile
new file mode 100644
index 00000000000..769107a2504
--- /dev/null
+++ b/games/knightcap-brain/Makefile
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile,v 1.1.1.1 2000/10/15 08:39:18 jlam Exp $
+
+DISTNAME= knightcap-brain-19980616
+CATEGORIES= games
+MASTER_SITES= ftp://samba.anu.edu.au/pub/KnightCap/
+DISTFILES= new_brain.dat
+
+MAINTAINER= jlam@netbsd.org
+HOMEPAGE= http://anu.samba.org/KnightCap/
+
+ONLY_FOR_PLATFORMS= *-*-i386
+
+DIST_SUBDIR= ${PKGNAME}
+
+EXTRACT_ONLY= # empty
+NO_WRKSUBDIR= # defined
+NO_CONFIGURE= # defined
+
+EGDIR= ${PREFIX}/share/examples/knightcap
+
+do-build:
+ ${SED} -e "s,@PREFIX@,${PREFIX},g" < ${FILESDIR}/newbrain.sh \
+ > ${WRKSRC}/newbrain.sh
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/newbrain.sh ${PREFIX}/bin/newbrain
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/new_brain.dat \
+ ${EGDIR}/brain.dat
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/games/knightcap-brain/files/md5 b/games/knightcap-brain/files/md5
new file mode 100644
index 00000000000..409777b48e1
--- /dev/null
+++ b/games/knightcap-brain/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 2000/10/15 08:39:18 jlam Exp $
+
+MD5 (knightcap-brain-19980616/new_brain.dat) = 49eaa4a221b40d74c08961223a2e7085
diff --git a/games/knightcap-brain/files/newbrain.sh b/games/knightcap-brain/files/newbrain.sh
new file mode 100644
index 00000000000..08ec3d24ea3
--- /dev/null
+++ b/games/knightcap-brain/files/newbrain.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+BRAIN_FILE=@PREFIX@/share/examples/knightcap/brain.dat
+
+args=`getopt f $*`
+if [ $? != 0 ]
+then
+ echo 'Usage: newbrain [-f] [directory]'
+ exit 2
+fi
+
+force=0
+
+set -- $args
+for arg
+do
+ shift
+ case "$arg" in
+ -f) force=1 ;;
+ --) break ;;
+ esac
+done
+
+dir=${1:-.} # default to copying brain to current directory
+
+if [ -f ${dir}/brain.dat -a ${force} -eq 0 ]
+then
+ echo "The file ${dir}/brain.dat already exists."
+ echo "Please move it out of the way, or use another directory."
+ exit 0
+fi
+
+install -c -m 644 ${BRAIN_FILE} ${dir}
diff --git a/games/knightcap-brain/pkg/COMMENT b/games/knightcap-brain/pkg/COMMENT
new file mode 100644
index 00000000000..2d16d2084bf
--- /dev/null
+++ b/games/knightcap-brain/pkg/COMMENT
@@ -0,0 +1 @@
+book of losing moves for KnightCap
diff --git a/games/knightcap-brain/pkg/DESCR b/games/knightcap-brain/pkg/DESCR
new file mode 100644
index 00000000000..33676aba7e7
--- /dev/null
+++ b/games/knightcap-brain/pkg/DESCR
@@ -0,0 +1,3 @@
+KnightCap does not have an opening book -- instead it keeps a file
+(brain.dat) of losing moves and inserts them in the hash table at the
+start of each search.
diff --git a/games/knightcap-brain/pkg/PLIST b/games/knightcap-brain/pkg/PLIST
new file mode 100644
index 00000000000..b84967e3ae2
--- /dev/null
+++ b/games/knightcap-brain/pkg/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2000/10/15 08:39:18 jlam Exp $
+bin/newbrain
+share/examples/knightcap/brain.dat
+@dirrm share/examples/knightcap