line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Nonogram::Loader::File;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1014
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
174
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub load {
|
7
|
0
|
|
|
0
|
1
|
|
my ($class, $file) = @_;
|
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
my ($height, $width, @lines);
|
10
|
0
|
0
|
|
|
|
|
open my $fh, '<', $file or die "Cannot open $file";
|
11
|
0
|
|
|
|
|
|
while(<$fh>) {
|
12
|
0
|
|
|
|
|
|
chomp;
|
13
|
0
|
0
|
|
|
|
|
next if /^#/;
|
14
|
0
|
0
|
|
|
|
|
if ( $_ eq '' ) {
|
15
|
0
|
0
|
|
|
|
|
unless ( $height ) {
|
16
|
0
|
|
|
|
|
|
$height = scalar @lines;
|
17
|
0
|
|
|
|
|
|
next;
|
18
|
|
|
|
|
|
|
}
|
19
|
0
|
|
|
|
|
|
last; # should be the end of the column clues
|
20
|
|
|
|
|
|
|
}
|
21
|
0
|
|
|
|
|
|
push @lines, $_;
|
22
|
|
|
|
|
|
|
}
|
23
|
0
|
|
|
|
|
|
$width = (scalar @lines) - $height;
|
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return ($height, $width, @lines);
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1;
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__
|