line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Solitaire::Verify::Solution::Base; |
2
|
|
|
|
|
|
|
$Games::Solitaire::Verify::Solution::Base::VERSION = '0.2401'; |
3
|
5
|
|
|
5
|
|
2458
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
142
|
|
4
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
130
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
22
|
use parent 'Games::Solitaire::Verify::Base'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
32
|
|
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
|
|
43301
|
my $s = shift; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# We use this instead of the accessor for speed. |
35
|
28800
|
|
|
|
|
43304
|
++$s->{_ln}; |
36
|
|
|
|
|
|
|
|
37
|
28800
|
|
|
|
|
39176
|
return shift( @{ $s->{_i} } ); |
|
28800
|
|
|
|
|
100071
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _calc_variant_args |
41
|
|
|
|
|
|
|
{ |
42
|
18
|
|
|
18
|
|
37
|
my $self = shift; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return [ |
45
|
18
|
100
|
|
|
|
110
|
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
|
|
46
|
my ( $self, $args ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
18
|
50
|
|
|
|
104
|
$self->_max_rank( exists( $args->{max_rank} ) ? $args->{max_rank} : 13 ); |
59
|
|
|
|
|
|
|
$self->_i( |
60
|
|
|
|
|
|
|
[ |
61
|
|
|
|
|
|
|
split /^/ms, |
62
|
|
|
|
|
|
|
do |
63
|
18
|
|
|
|
|
41
|
{ |
64
|
18
|
|
|
|
|
79
|
local $/; |
65
|
18
|
|
|
|
|
2329
|
my $t = readline( $args->{input_fh} ); |
66
|
18
|
|
|
|
|
11707
|
$t =~ s/ +$//gms; |
67
|
18
|
|
|
|
|
12241
|
$t; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
] |
70
|
|
|
|
|
|
|
); |
71
|
18
|
|
|
|
|
1594
|
$self->_ln(0); |
72
|
|
|
|
|
|
|
|
73
|
18
|
|
|
|
|
76
|
$self->_variant( $args->{variant} ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
$self->_variant_params( |
76
|
|
|
|
|
|
|
$self->_variant eq 'custom' |
77
|
|
|
|
|
|
|
? $args->{variant_params} |
78
|
18
|
100
|
|
|
|
200
|
: Games::Solitaire::Verify::VariantsMap->get_variant_by_id( |
79
|
|
|
|
|
|
|
$self->_variant() |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
18
|
|
|
|
|
103
|
$self->_V( $self->_calc_variant_args() ); |
84
|
|
|
|
|
|
|
|
85
|
18
|
|
|
|
|
53
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |