line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::ABC_Path::Generator::App; |
2
|
|
|
|
|
|
|
$Games::ABC_Path::Generator::App::VERSION = '0.4.2'; |
3
|
1
|
|
|
1
|
|
1640
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
547
|
use Pod::Usage qw(pod2usage); |
|
1
|
|
|
|
|
49375
|
|
|
1
|
|
|
|
|
88
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
10
|
use parent 'Games::ABC_Path::Generator::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
769
|
use Getopt::Long qw(GetOptionsFromArray); |
|
1
|
|
|
|
|
10067
|
|
|
1
|
|
|
|
|
6
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
190
|
use Games::ABC_Path::Generator; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
288
|
|
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__ |