line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::ABC_Path::Solver::Base; |
2
|
|
|
|
|
|
|
$Games::ABC_Path::Solver::Base::VERSION = '0.6.2'; |
3
|
2
|
|
|
2
|
|
67856
|
use warnings; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
872
|
use Games::ABC_Path::Solver::Constants; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
402
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
8847
|
|
|
8847
|
1
|
14430
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
8847
|
|
|
|
|
15087
|
my $self = bless {}, $class; |
14
|
|
|
|
|
|
|
|
15
|
8847
|
|
|
|
|
22875
|
$self->_init(@_); |
16
|
|
|
|
|
|
|
|
17
|
8847
|
|
|
|
|
18861
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
534
|
use integer; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
13
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _xy_to_int |
23
|
|
|
|
|
|
|
{ |
24
|
11421
|
|
|
11421
|
|
19402
|
my ( $self, $xy ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
11421
|
|
|
|
|
37778
|
return $xy->[$Y] * $LEN + $xy->[$X]; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _to_xy |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
0
|
|
0
|
my ( $self, $int ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
return ( ( $int / $LEN ), ( $int % $LEN ) ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _y_indexes |
38
|
|
|
|
|
|
|
{ |
39
|
455
|
|
|
455
|
|
1097
|
return ( 0 .. $LEN_LIM ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _x_indexes |
43
|
|
|
|
|
|
|
{ |
44
|
1742
|
|
|
1742
|
|
3761
|
return ( 0 .. $LEN_LIM ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _x_in_range |
48
|
|
|
|
|
|
|
{ |
49
|
2922
|
|
|
2922
|
|
4484
|
my ( $self, $x ) = @_; |
50
|
|
|
|
|
|
|
|
51
|
2922
|
|
100
|
|
|
11843
|
return ( $x >= 0 and $x < $LEN ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _y_in_range |
55
|
|
|
|
|
|
|
{ |
56
|
1374
|
|
|
1374
|
|
2300
|
my ( $self, $y ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
1374
|
|
|
|
|
2193
|
return $self->_x_in_range($y); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; # End of Games::ABC_Path::Solver::Base |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |