Chess::Game::MoveList is a specialized list class for recording the moves of a Chess::Game.
SYNOPSIS
$movelist = Chess::Game::MoveList->new("white", "black");
$wpawn = Chess::Game::Pawn->new("e2", "white");
$entry = $movelist->add_move($wpawn, "e2", "e4");
$true = $entry->get_piece() eq $entry;
$bpawn = Chess::Game::Pawn->new("e7", "black");
$entry = $movelist->add_move($bpawn, "e7", "e6");
$entry = $movelist->add_move($wpawn, "e4", "e5");
@del_entries = $movelist->delete_move(1, "white"); # delete the list
$true = $entries[0]->get_piece() eq $wpawn;
$true = $entries[0]->get_dest_square() eq "e4";
$true = $entries[1]->get_piece() eq $bpawn;
$true = $entries[1]->get_dest_square() eq "e6";
The Chess module provides a framework for writing chess programs with Perl. This class forms part of that framework, recording a log of all moves during a Chess::Game in such a fashion that the list can be used to undo moves that have been made.
Product's homepage
Requirements:
· Perl