Gene Boggs > Chess-Coverage-0.04 > Chess::Coverage

Download:
Chess-Coverage-0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.04   Source   Latest Release: Chess-Coverage-0.04_1

NAME ^

Chess::Coverage - Expose chess ply potential energy

SYNOPSIS ^

  use Chess::Coverage;
  $g = Chess::Coverage->new();
  $c = $g->coverage();

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 to return the indices of the attackers.

Produce images and animations 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.