NAME

Chess::Coverage - Expose chess ply potential energy

SYNOPSIS

use Chess::Coverage;
$g = Chess::Coverage->new();
$c = $g->coverage();
use Data::Dumper; $Data::Dumper::Sortkeys=1; die Dumper($c);

DESCRTIPTION

This module exposes the "potential energy" of a chess ply by returning a hash reference of the board positions, pieces and their "attack status."

* This module was a lot more complicated and slower, in the past. Modern chess packages have allowed me to vastly simplify this (to a single method, actually).

* Previous versions of this module listed the board positions that threatened or protected a given position. This module does the reverse (for the moment) and shows if positions are threatened or protected with a simple true value.

METHODS

new()

Return a new Chess::Coverage object.

coverage()

Return a data structure, keyed on board position, showing

occupant   => Human readable string of the piece name and color
index      => The C<Chess::Rep/Position> board position index.
move       => List of positions that are legal moves by the occupying piece
protected  => True (1) if the occupying piece is protected by its own color
threatened => True (1) if the occupying piece is threatened by the opponent

TO DO

Get Chess::Rep patched to return the indices of the attackers.

Produce an image of the coverage.

SEE ALSO

Chess::Rep

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT

Copyright 2007-2008, Gene Boggs.

This code is licensed under the same terms as Perl itself.