line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Solitaire::Verify::Solution::Base; |
2
|
|
|
|
|
|
|
$Games::Solitaire::Verify::Solution::Base::VERSION = '0.2402'; |
3
|
5
|
|
|
5
|
|
2493
|
use strict; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
201
|
|
4
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
133
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
26
|
use parent 'Games::Solitaire::Verify::Base'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
33
|
|
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
|
|
43154
|
my $s = shift; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# We use this instead of the accessor for speed. |
35
|
28800
|
|
|
|
|
43365
|
++$s->{_ln}; |
36
|
|
|
|
|
|
|
|
37
|
28800
|
|
|
|
|
39158
|
return shift( @{ $s->{_i} } ); |
|
28800
|
|
|
|
|
104333
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _calc_variant_args |
41
|
|
|
|
|
|
|
{ |
42
|
18
|
|
|
18
|
|
45
|
my $self = shift; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return [ |
45
|
18
|
100
|
|
|
|
167
|
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
|
|
53
|
my ( $self, $args ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
18
|
50
|
|
|
|
124
|
$self->_max_rank( exists( $args->{max_rank} ) ? $args->{max_rank} : 13 ); |
59
|
|
|
|
|
|
|
$self->_i( |
60
|
|
|
|
|
|
|
[ |
61
|
|
|
|
|
|
|
split /^/ms, |
62
|
|
|
|
|
|
|
do |
63
|
18
|
|
|
|
|
50
|
{ |
64
|
18
|
|
|
|
|
89
|
local $/; |
65
|
18
|
|
|
|
|
2665
|
my $t = readline( $args->{input_fh} ); |
66
|
18
|
|
|
|
|
11944
|
$t =~ s/ +$//gms; |
67
|
18
|
|
|
|
|
13183
|
$t; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
] |
70
|
|
|
|
|
|
|
); |
71
|
18
|
|
|
|
|
1634
|
$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
|
|
|
|
269
|
: Games::Solitaire::Verify::VariantsMap->get_variant_by_id( |
79
|
|
|
|
|
|
|
$self->_variant() |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
18
|
|
|
|
|
86
|
$self->_V( $self->_calc_variant_args() ); |
84
|
|
|
|
|
|
|
|
85
|
18
|
|
|
|
|
67
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |