File Coverage

blib/lib/Chess4p.pm
Criterion Covered Total %
statement 21 21 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 8 8 100.0
pod n/a
total 31 34 91.1


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             Chess4p, a library for chess related functionality.
4              
5             =head1 SYNOPSIS
6              
7             use Chess4p;
8              
9             use Chess4p::Common qw(...);
10              
11             $board = Chess4p::Board->fromFen();
12              
13             $board->push_move(Chess4p::Move->new(E2, E4);
14              
15             $board->fen();
16              
17             $board->ascii();
18              
19             $board->pop_move();
20              
21             ...
22              
23             =head1 DESCRIPTION
24              
25             Features include legal move generation, perft testing, UCI move input/output.
26              
27             Planned features include SAN move input/output and PGN parsing.
28              
29             Only 64-bit systems are supported.
30              
31             =head1 SEE ALSO
32              
33             =over 4
34              
35             =item L
36              
37             =item L
38              
39             =item L
40              
41             =back
42              
43             =head1 AUTHOR
44              
45             Ejner Borgbjerg
46              
47             =head1 COPYRIGHT
48              
49             Copyright (c) 2026 Ejner Borgbjerg. All rights reserved. This module is
50             Free Software. It may be modified and redistributed under the same terms as
51             Perl itself.
52              
53             =cut
54             package Chess4p;
55              
56 4     4   739215 use v5.36;
  4         16  
57              
58 4     4   24 use Config;
  4         12  
  4         238  
59 4     4   26 use Carp;
  4         9  
  4         601  
60              
61             BEGIN {
62             # only 64 bit systems are supported, because bitboard operations would need special code otherwise.
63 4 50 33 4   342 croak "64-bit Perl is required (ptrsize = 8). Current perl is not supported.\n" unless $Config{ptrsize} && $Config{ptrsize} == 8;
64             }
65              
66 4     4   2152 use lib '.';
  4         3347  
  4         26  
67              
68             our $VERSION = '0.0.2';
69              
70 4     4   1047 use Chess4p::Common;
  4         9  
  4         202  
71 4     4   3043 use Chess4p::Move;
  4         13  
  4         205  
72 4     4   3579 use Chess4p::Board;
  4         27  
  4         330  
73              
74             1;