line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Sudoku::Component::Result;
|
2
|
|
|
|
|
|
|
{
|
3
|
2
|
|
|
2
|
|
31294
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
52
|
|
5
|
2
|
|
|
2
|
|
12
|
use Carp;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
476
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01';
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use overload
|
10
|
|
|
|
|
|
|
'0+' => \&result,
|
11
|
|
|
|
|
|
|
'""' => \&result,
|
12
|
3
|
|
|
3
|
|
1223
|
'<=>' => sub { $_[0]->result <=> $_[1] },
|
13
|
2
|
|
|
2
|
|
1726
|
'cmp' => sub { $_[0]->result cmp $_[1] };
|
|
2
|
|
|
2
|
|
1223
|
|
|
2
|
|
|
|
|
36
|
|
|
2
|
|
|
|
|
783
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new {
|
16
|
3
|
|
|
3
|
1
|
2097
|
my $class = shift;
|
17
|
3
|
|
33
|
|
|
25
|
my $this = bless {}, (ref $class || $class);
|
18
|
|
|
|
|
|
|
|
19
|
3
|
100
|
|
|
|
11
|
if (@_ == 1) {
|
20
|
1
|
50
|
|
|
|
5
|
if (ref $_[0] eq 'HASH') {
|
21
|
0
|
|
|
|
|
0
|
my %options = %{ $_[0] };
|
|
0
|
|
|
|
|
0
|
|
22
|
0
|
|
0
|
|
|
0
|
$this->{result} = $options{result} || 0;
|
23
|
0
|
|
0
|
|
|
0
|
$this->{reason} = $options{reason} || '';
|
24
|
|
|
|
|
|
|
}
|
25
|
|
|
|
|
|
|
else {
|
26
|
1
|
|
|
|
|
5
|
$this->{result} = $_[0];
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
else {
|
30
|
2
|
|
|
|
|
7
|
my %options = @_;
|
31
|
2
|
|
100
|
|
|
53
|
$this->{result} = $options{result} || 0;
|
32
|
2
|
|
100
|
|
|
15
|
$this->{reason} = $options{reason} || '';
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
8
|
$this;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
11
|
|
|
11
|
1
|
2796
|
sub result { $_[0]->{result} }
|
39
|
2
|
|
|
2
|
1
|
983
|
sub reason { $_[0]->{reason} }
|
40
|
|
|
|
|
|
|
}
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1;
|
43
|
|
|
|
|
|
|
__END__
|