line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Solitaire::Verify::Solution::Base; |
2
|
|
|
|
|
|
|
$Games::Solitaire::Verify::Solution::Base::VERSION = '0.2403'; |
3
|
5
|
|
|
5
|
|
2403
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
141
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
128
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
25
|
use parent 'Games::Solitaire::Verify::Base'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
34
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# "_ln" is line number |
10
|
|
|
|
|
|
|
# "_st" is the "state" (or board/layout). |
11
|
|
|
|
|
|
|
# "_i" is input filehandle. |
12
|
|
|
|
|
|
|
# "_V" is short for variant arguments. |
13
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref( |
14
|
|
|
|
|
|
|
[ |
15
|
|
|
|
|
|
|
qw( |
16
|
|
|
|
|
|
|
_V |
17
|
|
|
|
|
|
|
_i |
18
|
|
|
|
|
|
|
_ln |
19
|
|
|
|
|
|
|
_variant |
20
|
|
|
|
|
|
|
_variant_params |
21
|
|
|
|
|
|
|
_st |
22
|
|
|
|
|
|
|
_max_rank |
23
|
|
|
|
|
|
|
_move |
24
|
|
|
|
|
|
|
_reached_end |
25
|
|
|
|
|
|
|
) |
26
|
|
|
|
|
|
|
] |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# _l is short for _get_line() |
30
|
|
|
|
|
|
|
sub _l |
31
|
|
|
|
|
|
|
{ |
32
|
28800
|
|
|
28800
|
|
42788
|
my $s = shift; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# We use this instead of the accessor for speed. |
35
|
28800
|
|
|
|
|
43670
|
++$s->{_ln}; |
36
|
|
|
|
|
|
|
|
37
|
28800
|
|
|
|
|
40251
|
return shift( @{ $s->{_i} } ); |
|
28800
|
|
|
|
|
102263
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _calc_variant_args |
41
|
|
|
|
|
|
|
{ |
42
|
18
|
|
|
18
|
|
45
|
my $self = shift; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return [ |
45
|
18
|
100
|
|
|
|
146
|
variant => $self->_variant(), |
46
|
|
|
|
|
|
|
( |
47
|
|
|
|
|
|
|
( $self->_variant eq 'custom' ) |
48
|
|
|
|
|
|
|
? ( 'variant_params' => $self->_variant_params() ) |
49
|
|
|
|
|
|
|
: () |
50
|
|
|
|
|
|
|
) |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _init |
55
|
|
|
|
|
|
|
{ |
56
|
18
|
|
|
18
|
|
55
|
my ( $self, $args ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
18
|
50
|
|
|
|
127
|
$self->_max_rank( exists( $args->{max_rank} ) ? $args->{max_rank} : 13 ); |
59
|
|
|
|
|
|
|
$self->_i( |
60
|
|
|
|
|
|
|
[ |
61
|
|
|
|
|
|
|
split /^/ms, |
62
|
|
|
|
|
|
|
do |
63
|
18
|
|
|
|
|
39
|
{ |
64
|
18
|
|
|
|
|
82
|
local $/; |
65
|
18
|
|
|
|
|
2668
|
my $t = readline( $args->{input_fh} ); |
66
|
18
|
|
|
|
|
11918
|
$t =~ s/ +$//gms; |
67
|
18
|
|
|
|
|
13408
|
$t; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
] |
70
|
|
|
|
|
|
|
); |
71
|
18
|
|
|
|
|
1589
|
$self->_ln(0); |
72
|
|
|
|
|
|
|
|
73
|
18
|
|
|
|
|
88
|
$self->_variant( $args->{variant} ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
$self->_variant_params( |
76
|
|
|
|
|
|
|
$self->_variant eq 'custom' |
77
|
|
|
|
|
|
|
? $args->{variant_params} |
78
|
18
|
100
|
|
|
|
232
|
: Games::Solitaire::Verify::VariantsMap->get_variant_by_id( |
79
|
|
|
|
|
|
|
$self->_variant() |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
18
|
|
|
|
|
130
|
$self->_V( $self->_calc_variant_args() ); |
84
|
|
|
|
|
|
|
|
85
|
18
|
|
|
|
|
58
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |