NAME

Move - Chess move class

SYNOPSIS

use Chess4p::Move;

my $move = Move->new($from, $to);

say $move->uci();

DESCRIPTION

Move objects encapsulate the obvious from/to square properties. Furthermore, optional property promotion piece.

METHODS

new($from, $to, $piece_type);

Constructor. Create a Move by from/to squares, and optional promotion piece type. From/to are non-negative integers from 0 to 63. Piece type is one of 'Q', 'R', 'B', or 'N'.

from()

Get the from square.

to()

Get the to square.

promotion()

Get the promotion piece type, or undefined if none.

uci()

Get the UCI move representation.

SEE ALSO

There are many methods on Chess4p::Board that deal with moves, among them those that deal with SAN input/output - those methods need the Board context.

AUTHOR

Ejner Borgbjerg

LICENSE

Perl Artistic License, GPL