Copyright © 1999-2006 Gregor N. Purdy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This is an early conversion of my first chess-related Perl program, chess.pl, which provided just enough functionality to permit tracking the movements of pieces throughout a game. One notable feature is the ability to provide incomplete ply notation, allowing the program to figure out, for example, the type of the piece being moved, or whether the ply represents a capture (x) or occupation (-). This functionality will be broadened in the future to permit partial space specification (e.g. `cxd4'), and other cases of standard chess move notation.
diff -Naur Games-Chess-0.002 Games-Chess-0.002.patchThey are intended to be used with the patch program (see below).
The patches are to Chess.pm and Chess.pod, and fix a small bug and address some discrepancies between the documentation and the code:
cd $STAGE
ftp ...
bin
cd ...
get Games-Chess-0.002.tar.gz
cd ...
get Games-Chess-Referee-0.002.tar.gz
bye
tar xvzf Games-Chess-0.002.tar.gz
tar xvzf Games-Chess-Referee-0.002.tar.gz
cp -a Games-Chess-0.002 Games-Chess-0.002.patch
cd Games-Chess-0.002.patch
patch -p1 < $STAGE/Games-Chess-Referee-0.002/gc-0.002.diff
cd $STAGE/Games-Chess-0.002.patch
perl Makefile.PL
make
make test
make install
cd $STAGE/Games-Chess-Referee-0.002
perl Makefile.PL
make
make test
make install
Very abbreviated notation (such as xb4, c5, dxe7, QxR, etc. would be great, with ambiguity detection).
Also, much more work needs to be done to create a fully functional referee. Subsequent to that, however, Perl-built chess bots could be possible, and the referee could be enhanced to the point that it could be used for on-line chess matches.
Interesting future work would be to wrap the GNU chess engine in a Perl blanket. This would be most interesting if it was done in such a way that we weren't just putting a layer over the terminal interface, but rather, turning the core of the C code into a Perl-wrapped engine that interfaces with the board via the Referee.
Included a small script, tryme, that has the same test game in it as the test t/referee.t. Run the tryme script thusly (if running before installing the package):
perl -Iblib/lib trymeso you can see its output.
Removed the exit() statement that prevented the t/referee.t test from doing anything very interesting [:-)].