line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::ABC_Path::Generator::App; |
2
|
|
|
|
|
|
|
$Games::ABC_Path::Generator::App::VERSION = '0.4.3'; |
3
|
1
|
|
|
1
|
|
1721
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
599
|
use Pod::Usage qw(pod2usage); |
|
1
|
|
|
|
|
52745
|
|
|
1
|
|
|
|
|
90
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
8
|
use parent 'Games::ABC_Path::Generator::Base'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
851
|
use Getopt::Long qw(GetOptionsFromArray); |
|
1
|
|
|
|
|
10540
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
181
|
use Games::ABC_Path::Generator; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
281
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _argv |
17
|
|
|
|
|
|
|
{ |
18
|
0
|
|
|
0
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
if (@_) |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
|
|
|
$self->{_argv} = shift; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return $self->{_argv}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _init |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
|
|
my ( $self, $args ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$self->_argv( $args->{argv} ); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub run |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $seed; |
43
|
0
|
|
|
|
|
|
my $mode = 'riddle'; |
44
|
0
|
|
|
|
|
|
my $man = 0; |
45
|
0
|
|
|
|
|
|
my $help = 0; |
46
|
0
|
0
|
|
|
|
|
if ( |
47
|
|
|
|
|
|
|
!GetOptionsFromArray( |
48
|
|
|
|
|
|
|
$self->_argv(), |
49
|
|
|
|
|
|
|
'seed=i' => \$seed, |
50
|
|
|
|
|
|
|
'mode=s' => \$mode, |
51
|
|
|
|
|
|
|
'help|h' => \$help, |
52
|
|
|
|
|
|
|
man => \$man, |
53
|
|
|
|
|
|
|
) |
54
|
|
|
|
|
|
|
) |
55
|
|
|
|
|
|
|
{ |
56
|
0
|
|
|
|
|
|
pod2usage(2); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
if ($help) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
60
|
|
|
|
|
|
|
{ |
61
|
0
|
|
|
|
|
|
pod2usage(1); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
elsif ($man) |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
|
|
|
pod2usage( -verbose => 2 ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
elsif ( !defined($seed) ) |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
|
|
|
die "Seed not specified! See --help."; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
else |
72
|
|
|
|
|
|
|
{ |
73
|
0
|
|
|
|
|
|
my $gen = Games::ABC_Path::Generator->new( { seed => $seed, } ); |
74
|
|
|
|
|
|
|
|
75
|
0
|
0
|
|
|
|
|
if ( $mode eq 'final' ) |
|
|
0
|
|
|
|
|
|
76
|
|
|
|
|
|
|
{ |
77
|
0
|
|
|
|
|
|
print $gen->calc_final_layout()->as_string( {} ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
elsif ( $mode eq 'riddle' ) |
80
|
|
|
|
|
|
|
{ |
81
|
0
|
|
|
|
|
|
my $riddle = $gen->calc_riddle(); |
82
|
0
|
|
|
|
|
|
my $riddle_string = $riddle->get_riddle_v1_string; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
print sprintf( "ABC Path Solver Layout Version 1:\n%s", |
85
|
|
|
|
|
|
|
$riddle_string, ); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} |
89
|
0
|
|
|
|
|
|
return; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; # End of Games::ABC_Path::Generator::App |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |