line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::ABC_Path::Solver::Base; |
2
|
|
|
|
|
|
|
$Games::ABC_Path::Solver::Base::VERSION = '0.6.1'; |
3
|
2
|
|
|
2
|
|
50598
|
use warnings; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
42
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
816
|
use Games::ABC_Path::Solver::Constants; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
320
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
8847
|
|
|
8847
|
1
|
10089
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
8847
|
|
|
|
|
10101
|
my $self = bless {}, $class; |
14
|
|
|
|
|
|
|
|
15
|
8847
|
|
|
|
|
15822
|
$self->_init(@_); |
16
|
|
|
|
|
|
|
|
17
|
8847
|
|
|
|
|
12993
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
386
|
use integer; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
10
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _xy_to_int |
23
|
|
|
|
|
|
|
{ |
24
|
11421
|
|
|
11421
|
|
13066
|
my ($self, $xy) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
11421
|
|
|
|
|
26732
|
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
|
|
846
|
return (0 .. $LEN_LIM); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _x_indexes |
43
|
|
|
|
|
|
|
{ |
44
|
1742
|
|
|
1742
|
|
2764
|
return (0 .. $LEN_LIM); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _x_in_range |
48
|
|
|
|
|
|
|
{ |
49
|
2922
|
|
|
2922
|
|
3148
|
my ($self, $x) = @_; |
50
|
|
|
|
|
|
|
|
51
|
2922
|
|
100
|
|
|
8401
|
return ($x >= 0 and $x < $LEN); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _y_in_range |
55
|
|
|
|
|
|
|
{ |
56
|
1374
|
|
|
1374
|
|
1910
|
my ($self, $y) = @_; |
57
|
|
|
|
|
|
|
|
58
|
1374
|
|
|
|
|
1578
|
return $self->_x_in_range($y); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; # End of Games::ABC_Path::Solver::Base |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |