blib/lib/Games/Checkers/Board/_4x4.pm untested

filter: Statementstmt 0.0% 0 / 134 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 21 Podpod n/a totaltotal 0.0% 0 / 155 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Games::Checkers, Copyright (C) 1996-2012 Mikhael Goikhman, migo@cpan.org
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15  
16 package Games::Checkers::Board::_4x4;
17  
18 use strict;
19 use warnings;
20  
21 use base 'Games::Checkers::Board';
22 use Games::Checkers::Constants;
23  
24 use constant size_x => 4;
25 use constant size_y => 4;
26 use constant locs => 8;
27 use constant default_rows => 1;
28  
29 use constant loc_directions => [
30 [ NL, 2, NL, NL ], [ 2, 3, NL, NL ],
31 [ 4, 5, 0, 1 ], [ 5, NL, 1, NL ],
32 [ NL, 6, NL, 2 ], [ 6, 7, 2, 3 ],
33 [ NL, NL, 4, 5 ], [ NL, NL, 5, NL ],
34 ];
35  
36 use constant is_crowning => [
37 [
38 0, 0,
39 0, 0,
40 0, 0,
41 1, 1,
42 ], [
43 1, 1,
44 0, 0,
45 0, 0,
46 0, 0,
47 ]
48 ];
49  
50 use constant pawn_step => [
51 [
52 [ 2 ], [ 2, 3 ],
53 [ 4, 5 ], [ 5 ],
54 [ 6 ], [ 6, 7 ],
55 [ ], [ ],
56 ], [
57 [ ], [ ],
58 [ 0, 1 ], [ 1 ],
59 [ 2 ], [ 2, 3 ],
60 [ 4, 5 ], [ 5 ],
61 ]
62 ];
63  
64 use constant pawn_beat => [
65 [ 5 ], [ 4 ],
66 [ 7 ], [ 6 ],
67 [ 1 ], [ 0 ],
68 [ 3 ], [ 2 ],
69 ];
70  
71 use constant pawn_beat_forward => [
72 [
73 [ 5 ], [ 4 ],
74 [ 7 ], [ 6 ],
75 [ ], [ ],
76 [ ], [ ],
77 ], [
78 [ ], [ ],
79 [ ], [ ],
80 [ 1 ], [ 0 ],
81 [ 3 ], [ 2 ],
82 ]
83 ];
84  
85 use constant pawn_beat_8dirs => [
86 [ 5 ], [ 4 ],
87 [ 7 ], [ 6 ],
88 [ 1 ], [ 0 ],
89 [ 3 ], [ 2 ],
90 ];
91  
92 use constant king_step => [
93 [ 2, 5, 7 ],
94 [ 2, 3, 4 ],
95 [ 4, 5, 0, 1, 7 ],
96 [ 5, 1, 6 ],
97 [ 6, 2, 1 ],
98 [ 6, 7, 2, 3, 0 ],
99 [ 4, 5, 3 ],
100 [ 5, 2, 0 ],
101 ];
102  
103 use constant king_beat => [
104 [ 5, 7 ],
105 [ 4 ],
106 [ 7 ],
107 [ 6 ],
108 [ 1 ],
109 [ 0 ],
110 [ 3 ],
111 [ 2, 0 ],
112 ];
113  
114 use constant king_step_short => [
115 [ 2 ], [ 2, 3 ],
116 [ 4, 5, 0, 1 ], [ 5, 1 ],
117 [ 6, 2 ], [ 6, 7, 2, 3 ],
118 [ 4, 5 ], [ 5 ],
119 ];
120  
121 use constant king_beat_short => [
122 [ 5 ], [ 4 ],
123 [ 7 ], [ 6 ],
124 [ 1 ], [ 0 ],
125 [ 3 ], [ 2 ],
126 ];
127  
128 use constant king_beat_8dirs => [
129 [ 5, 7 ],
130 [ 4 ],
131 [ 7 ],
132 [ 6 ],
133 [ 1 ],
134 [ 0 ],
135 [ 3 ],
136 [ 2, 0 ],
137 ];
138  
139 use constant enclosed_locs => [
140 { 5 => [ 2 ], 7 => [ 2, 5 ] },
141 { 4 => [ 2 ] },
142 { 7 => [ 5 ] },
143 { 6 => [ 5 ] },
144 { 1 => [ 2 ] },
145 { 0 => [ 2 ] },
146 { 3 => [ 5 ] },
147 { 0 => [ 5, 2 ], 2 => [ 5 ] },
148 ];
149  
150 use constant enclosed_8dirs_locs => [
151 { 5 => [ 2 ], 7 => [ 2, 5 ] },
152 { 4 => [ 2 ] },
153 { 7 => [ 5 ] },
154 { 6 => [ 5 ] },
155 { 1 => [ 2 ] },
156 { 0 => [ 2 ] },
157 { 3 => [ 5 ] },
158 { 0 => [ 5, 2 ], 2 => [ 5 ] },
159 ];
160  
161 1;