The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chess::Piece::Knight - an object representing a knight in a game of chess

SYNOPSIS

    $knight = Chess::Piece::Knight->new("g1", "white", 
                                        "White King's knight");
    $true = $knight->can_reach("f3");
    $true = $knight->can_reach("e2");
    $false = $knight->can_reach("g3");

DESCRIPTION

The Chess module provides a framework for writing chess programs with Perl. This class forms part of the framework, representing a knight in a Chess::Game.

METHODS

Construction

new()

Constructs a new Chess::Piece::Knight. Requires two scalar parameters containing the initial square and color for this piece. Optionally takes a third scalar parameter containing a description of this piece.

    $knight = Chess::Piece::Knight->new("g1", "white");
    $knight = Chess::Piece::Knight->new("g8", "black", 
                                        "Black King's knight");

Class methods

There are no class methods for this class.

Object methods

reachable_squares()

Overrides base class version. Returns a list of squares that this pawn can reach from its current position. See "reachable_squares()" in Chess::Piece for more details on this method.

DIAGNOSTICS

This subclass of Chess::Piece does not generate any warning messages by itself. Please see DIAGNOSTICS in Chess::Piece or DIAGNOSTICS in Chess::Board for possible error messages your program may produce.

BUGS

Please report any bugs to the author.

AUTHOR

Brian Richardson <bjr@cpan.org>

COPYRIGHT

Copyright (c) 2002, 2005 Brian Richardson. All rights reserved. This module is Free Software. It may be modified and redistributed under the same terms as Perl itself.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 23:

You forgot a '=back' before '=head2'

Around line 25:

'=item' outside of any '=over'

Around line 35:

You forgot a '=back' before '=head2'

Around line 41:

'=item' outside of any '=over'