NAME

Perft - provides Perft functionality.

SYNOPSIS

use Chess4p;
use Chess4p::Perft qw(perft);

my $board = Chess4p::Board->fromFen($fen);
my $depth = 5;

my $result = perft(5, $board);

DESCRIPTION

Perft calculates the number of leaf positions reached from a given position, in a given halfmove depth.

FUNCTIONS

perft($depth, $board);

Calculates and returns the perft number for the position given by $board in the depth $depth.

Perft numbers are also printed for each first move, similar to what Stockfish does in its 'go perft' command. This is useful for debugging the legal move generator.

AUTHOR

Ejner Borgbjerg

LICENSE

Perl Artistic License, GPL