line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Bingo::Column; |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
7977
|
use strict; |
|
25
|
|
|
|
|
50
|
|
|
25
|
|
|
|
|
902
|
|
4
|
25
|
|
|
25
|
|
132
|
use warnings; |
|
25
|
|
|
|
|
44
|
|
|
25
|
|
|
|
|
804
|
|
5
|
25
|
|
|
25
|
|
7054
|
use integer; |
|
25
|
|
|
|
|
101
|
|
|
25
|
|
|
|
|
141
|
|
6
|
25
|
|
|
25
|
|
11079
|
use Games::Bingo; |
|
25
|
|
|
|
|
79
|
|
|
25
|
|
|
|
|
826
|
|
7
|
25
|
|
|
25
|
|
146
|
use vars qw(@ISA $VERSION); |
|
25
|
|
|
|
|
53
|
|
|
25
|
|
|
|
|
11197
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
@ISA = qw(Games::Bingo); |
10
|
|
|
|
|
|
|
$VERSION = '0.17'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
3240
|
|
|
3240
|
1
|
13637
|
my $class = shift; |
14
|
3240
|
|
|
|
|
3712
|
my $label = shift; |
15
|
3240
|
|
|
|
|
16434
|
my @array = sort _reverse (@_); |
16
|
|
|
|
|
|
|
|
17
|
3240
|
100
|
|
|
|
38373
|
my $self = bless { |
18
|
|
|
|
|
|
|
label => $label?$label:0, |
19
|
|
|
|
|
|
|
_array => \@array |
20
|
|
|
|
|
|
|
}, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
25397
|
|
|
25397
|
|
29608
|
sub _reverse { $b <=> $a } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub populate { |
26
|
2680
|
|
|
2680
|
1
|
8806
|
my ($self, $value) = @_; |
27
|
|
|
|
|
|
|
|
28
|
2680
|
|
|
|
|
2637
|
push @{$self->{_array}}, $value; |
|
2680
|
|
|
|
|
5218
|
|
29
|
|
|
|
|
|
|
|
30
|
2680
|
|
|
|
|
3118
|
@{$self->{_array}} = sort _reverse @{$self->{_array}}; |
|
2680
|
|
|
|
|
11379
|
|
|
2680
|
|
|
|
|
14655
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_random_number { |
34
|
2687
|
|
|
2687
|
1
|
7550
|
my ($self, $do_splice) = @_; |
35
|
|
|
|
|
|
|
|
36
|
2687
|
|
|
|
|
4526
|
my $pos = $self->random($self->count_numbers); |
37
|
|
|
|
|
|
|
|
38
|
2687
|
|
|
|
|
5154
|
my $number = $self->{_array}->[$pos]; |
39
|
2687
|
100
|
|
|
|
5098
|
splice(@{$self->{_array}}, $pos, 1) if $do_splice; |
|
2686
|
|
|
|
|
7205
|
|
40
|
|
|
|
|
|
|
|
41
|
2687
|
|
|
|
|
6048
|
return $number; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub count_numbers { |
45
|
5343
|
|
|
5343
|
1
|
6703
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
5343
|
|
|
|
|
5691
|
return scalar @{$self->{_array}}; |
|
5343
|
|
|
|
|
27800
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_highest_number { |
51
|
2660
|
|
|
2660
|
1
|
12448
|
my ($self, $do_splice) = @_; |
52
|
|
|
|
|
|
|
|
53
|
2660
|
|
|
|
|
2583
|
my $number; |
54
|
2660
|
100
|
|
|
|
4447
|
if ($do_splice) { |
55
|
2658
|
|
|
|
|
2446
|
$number = shift(@{$self->{_array}}); |
|
2658
|
|
|
|
|
4445
|
|
56
|
2658
|
|
|
|
|
5938
|
return $number; |
57
|
|
|
|
|
|
|
} else { |
58
|
2
|
|
|
|
|
7
|
return $self->{_array}->[0]; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub get_label { |
63
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
9
|
return $self->{label}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |