line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::ABC_Path::Solver::Base; |
2
|
|
|
|
|
|
|
$Games::ABC_Path::Solver::Base::VERSION = '0.6.0'; |
3
|
2
|
|
|
2
|
|
64716
|
use warnings; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
102
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1121
|
use Games::ABC_Path::Solver::Constants; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
357
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
8847
|
|
|
8847
|
1
|
12635
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
8847
|
|
|
|
|
12792
|
my $self = bless {}, $class; |
14
|
|
|
|
|
|
|
|
15
|
8847
|
|
|
|
|
20755
|
$self->_init(@_); |
16
|
|
|
|
|
|
|
|
17
|
8847
|
|
|
|
|
16353
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
522
|
use integer; |
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
13
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _xy_to_int |
23
|
|
|
|
|
|
|
{ |
24
|
11421
|
|
|
11421
|
|
15481
|
my ($self, $xy) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
11421
|
|
|
|
|
31492
|
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
|
|
1082
|
return (0 .. $LEN_LIM); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _x_indexes |
43
|
|
|
|
|
|
|
{ |
44
|
1742
|
|
|
1742
|
|
3423
|
return (0 .. $LEN_LIM); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _x_in_range |
48
|
|
|
|
|
|
|
{ |
49
|
2922
|
|
|
2922
|
|
3750
|
my ($self, $x) = @_; |
50
|
|
|
|
|
|
|
|
51
|
2922
|
|
100
|
|
|
10484
|
return ($x >= 0 and $x < $LEN); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _y_in_range |
55
|
|
|
|
|
|
|
{ |
56
|
1374
|
|
|
1374
|
|
1990
|
my ($self, $y) = @_; |
57
|
|
|
|
|
|
|
|
58
|
1374
|
|
|
|
|
1922
|
return $self->_x_in_range($y); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; # End of Games::ABC_Path::Solver::Base |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |