Chess::PGN::Parse 0.19
Sponsored Links
Chess::PGN::Parse 0.19 Ranking & Summary
File size:
0.026 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
6222
Date added:
2007-08-01
Publisher:
Giuseppe Maxia
Publisher URL:
http://search.cpan.org/~g
Chess::PGN::Parse 0.19 description
Chess::PGN::Parse is a Perl module that reads and parses PGN (Portable Game Notation) Chess files.
SYNOPSIS
use Chess::PGN::Parse;
use English qw( -no_match_vars );
my $pgnfile = "kk_2001.pgn";
my $pgn = new Chess::PGN::Parse $pgnfile
or die "cant open $pgnfilen";
while ($pgn->read_game()) {
print $pgn->white, ", " , $pgn->black, ", ",
$pgn->result, ", ",
$pgn->game, "n";
}
use Chess::PGN::Parse;
my $text ="";
{
local $INPUT_RECORD_SEPARATOR = undef;
open PGN "< $pgnfile" or die;
$text =
;
close $text;
}
# reads from string instead of a file
my $pgn = new Chess::PGN::Parse undef, $text;
while ($pgn->read_game()) {
print $pgn->white, ", " , $pgn->black, ", ",
$pgn->result, ", ",
$pgn->game, "n";
}
use Chess::PGN::Parse;
my $pgnfile = "kk_2001.pgn";
my $pgn = new Chess::PGN::Parse $pgnfile
or die "cant open $pgnfilen";
my @games = $pgn->smart_read_all();
Chess::PGN::Parse offers a range of methods to read and manipulate Portable Game Notation files. PGN files contain chess games produced by chess programs following a standard format (http://www.schachprobleme.de/chessml/faq/pgn/). It is among the preferred means of chess games distribution. Being a public, well established standard, PGN is understood by many chess archive programs. Parsing simple PGN files is not difficult. However, dealing with some of the intricacies of the Standard is less than trivial. This module offers a clean handle toward reading and parsing complex PGN files.
A PGN file has several tags, which are key/values pairs at the header of each game, in the format [key "value"]
After the header, the game follows. A string of numbered chess moves, optionally interrupted by braced comments and recursive parenthesized variants and comments. While dealing with simple braced comments is straightforward, parsing nested comments can give you more than a headache.
Chess::PGN::Parse most immediate methods are: read_game() reads one game, separating the tags and the game text.
parse_game() parse the current game, and stores the moves into an
array and optionally saves the comments into an array of hashes
for furter usage. It can deal with nested comments and recursive
variations.
quick_parse_game() Same as the above, but doesnt save the comments,
which are just stripped from the text. It cant deal with nested
comments. Should be the preferred method when we know that we are
dealing with simple PGNs.
smart_parse_game() Best of the above methods. A preliminary check
will call parse_game() or quick_parse_game(), depending on the
presence of nested comments in the game.
read_all(), quick_read_all(), smart_read_all() will read all the records
in the current PGN file and return an array of hashes with all the
parsed details from the games.
SYNOPSIS
use Chess::PGN::Parse;
use English qw( -no_match_vars );
my $pgnfile = "kk_2001.pgn";
my $pgn = new Chess::PGN::Parse $pgnfile
or die "cant open $pgnfilen";
while ($pgn->read_game()) {
print $pgn->white, ", " , $pgn->black, ", ",
$pgn->result, ", ",
$pgn->game, "n";
}
use Chess::PGN::Parse;
my $text ="";
{
local $INPUT_RECORD_SEPARATOR = undef;
open PGN "< $pgnfile" or die;
$text =
close $text;
}
# reads from string instead of a file
my $pgn = new Chess::PGN::Parse undef, $text;
while ($pgn->read_game()) {
print $pgn->white, ", " , $pgn->black, ", ",
$pgn->result, ", ",
$pgn->game, "n";
}
use Chess::PGN::Parse;
my $pgnfile = "kk_2001.pgn";
my $pgn = new Chess::PGN::Parse $pgnfile
or die "cant open $pgnfilen";
my @games = $pgn->smart_read_all();
Chess::PGN::Parse offers a range of methods to read and manipulate Portable Game Notation files. PGN files contain chess games produced by chess programs following a standard format (http://www.schachprobleme.de/chessml/faq/pgn/). It is among the preferred means of chess games distribution. Being a public, well established standard, PGN is understood by many chess archive programs. Parsing simple PGN files is not difficult. However, dealing with some of the intricacies of the Standard is less than trivial. This module offers a clean handle toward reading and parsing complex PGN files.
A PGN file has several tags, which are key/values pairs at the header of each game, in the format [key "value"]
After the header, the game follows. A string of numbered chess moves, optionally interrupted by braced comments and recursive parenthesized variants and comments. While dealing with simple braced comments is straightforward, parsing nested comments can give you more than a headache.
Chess::PGN::Parse most immediate methods are: read_game() reads one game, separating the tags and the game text.
parse_game() parse the current game, and stores the moves into an
array and optionally saves the comments into an array of hashes
for furter usage. It can deal with nested comments and recursive
variations.
quick_parse_game() Same as the above, but doesnt save the comments,
which are just stripped from the text. It cant deal with nested
comments. Should be the preferred method when we know that we are
dealing with simple PGNs.
smart_parse_game() Best of the above methods. A preliminary check
will call parse_game() or quick_parse_game(), depending on the
presence of nested comments in the game.
read_all(), quick_read_all(), smart_read_all() will read all the records
in the current PGN file and return an array of hashes with all the
parsed details from the games.
Chess::PGN::Parse 0.19 Screenshot
Sponsored Links
Chess::PGN::Parse 0.19 Keywords
PGN
Parse 0.19
ChessPGNParse
Portable Game Notation
Perl module
game
read
chess
comments
reads
parse
Chess::PGN::Parse 0.19
Libraries
Programming
Bookmark Chess::PGN::Parse 0.19
Chess::PGN::Parse 0.19 Copyright
WareSeeker periodically updates pricing and software information of Chess::PGN::Parse 0.19 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Chess::PGN::Parse 0.19 Edition. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Chess::PGN::Parse 0.19 Related Software
Emacs Chess is an object-oriented library written in Elisp for manipulating chess objects (games, plies, positions, etc.), and f
Chess::ICClib is a Perl interface to Internet Chess Server commands.
Chess::ChessKit is a set of program to translate chess notations and analyses game by moves count.
Chess::FIDE::Player is a Perl module to parse player data from FIDE Rating List.
IRC-Chess project is a 2-player chess game for IRC which turns a computer into an IRC chess bot.
Brutal Chess is a 3D chess game with several levels of AI inspired by Battle Chess released by Interplay circa 1988.
gnome-chess is chess game, a graphical user interface for playing chess.
Vulcan Chess allows you play against the computer in a chess variant inspired by a certain well-known science-fiction TV series.
My Software
You have not saved any software. Click "Save" next to each software to save it to your software basket
Related Information
Sponsored Links
TOP POPULAR DOWNLOAD