line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Sudoku::OO::Set::Square; |
2
|
2
|
|
|
2
|
|
19
|
use Games::Sudoku::OO::Set; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
512
|
|
3
|
|
|
|
|
|
|
@ISA = ("Games::Sudoku::OO::Set"); |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
97
|
|
|
97
|
0
|
150
|
my $proto = shift; |
8
|
97
|
|
33
|
|
|
471
|
my $class = ref($proto) || $proto; |
9
|
97
|
|
|
|
|
333
|
my $self = $class->SUPER::new(@_); |
10
|
97
|
|
|
|
|
236
|
bless ($self, $class); # reconsecrate |
11
|
97
|
|
|
|
|
483
|
return $self; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub setBackReference { |
18
|
985
|
|
|
985
|
0
|
1259
|
my $self = shift; |
19
|
985
|
|
|
|
|
1807
|
my $cell = shift; |
20
|
985
|
|
|
|
|
4100
|
$cell->setSquare($self); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub toStr{ |
25
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
my $string = shift; |
27
|
0
|
|
|
|
|
|
my $size = sqrt @{$self->{CELLS}}; |
|
0
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
for (my $row =0 ; $row < $size; $row++){ |
29
|
0
|
|
|
|
|
|
for (my $col=0; $col < $size; $col++){ |
30
|
0
|
|
|
|
|
|
my $square = $col + $row*$size; |
31
|
0
|
|
|
|
|
|
my $cell = ${$self->{CELLS}}[$square]; |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$string .= $cell->toStr(); |
33
|
|
|
|
|
|
|
} |
34
|
0
|
|
|
|
|
|
$string .="\n"; |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
return $string; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
1; |