line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Bingo::Column; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
5058
|
use strict; |
|
24
|
|
|
|
|
42
|
|
|
24
|
|
|
|
|
773
|
|
4
|
24
|
|
|
24
|
|
107
|
use warnings; |
|
24
|
|
|
|
|
34
|
|
|
24
|
|
|
|
|
697
|
|
5
|
24
|
|
|
24
|
|
4070
|
use integer; |
|
24
|
|
|
|
|
95
|
|
|
24
|
|
|
|
|
123
|
|
6
|
24
|
|
|
24
|
|
8160
|
use Games::Bingo; |
|
24
|
|
|
|
|
54
|
|
|
24
|
|
|
|
|
838
|
|
7
|
24
|
|
|
24
|
|
123
|
use vars qw(@ISA $VERSION); |
|
24
|
|
|
|
|
32
|
|
|
24
|
|
|
|
|
18744
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
@ISA = qw(Games::Bingo); |
10
|
|
|
|
|
|
|
$VERSION = '0.18'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
3636
|
|
|
3636
|
1
|
12059
|
my $class = shift; |
14
|
3636
|
|
|
|
|
2756
|
my $label = shift; |
15
|
3636
|
|
|
|
|
14252
|
my @array = sort _reverse (@_); |
16
|
|
|
|
|
|
|
|
17
|
3636
|
100
|
|
|
|
15880
|
my $self = bless { |
18
|
|
|
|
|
|
|
label => $label?$label:0, |
19
|
|
|
|
|
|
|
_array => \@array |
20
|
|
|
|
|
|
|
}, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
28477
|
|
|
28477
|
|
27670
|
sub _reverse { $b <=> $a } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub populate { |
26
|
3010
|
|
|
3010
|
1
|
6043
|
my ($self, $value) = @_; |
27
|
|
|
|
|
|
|
|
28
|
3010
|
|
|
|
|
2189
|
push @{$self->{_array}}, $value; |
|
3010
|
|
|
|
|
4238
|
|
29
|
|
|
|
|
|
|
|
30
|
3010
|
|
|
|
|
2588
|
@{$self->{_array}} = sort _reverse @{$self->{_array}}; |
|
3010
|
|
|
|
|
9412
|
|
|
3010
|
|
|
|
|
5920
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_random_number { |
34
|
3017
|
|
|
3017
|
1
|
7922
|
my ($self, $do_splice) = @_; |
35
|
|
|
|
|
|
|
|
36
|
3017
|
|
|
|
|
3882
|
my $pos = $self->random($self->count_numbers); |
37
|
|
|
|
|
|
|
|
38
|
3017
|
|
|
|
|
3978
|
my $number = $self->{_array}->[$pos]; |
39
|
3017
|
100
|
|
|
|
4462
|
splice(@{$self->{_array}}, $pos, 1) if $do_splice; |
|
3016
|
|
|
|
|
4552
|
|
40
|
|
|
|
|
|
|
|
41
|
3017
|
|
|
|
|
4886
|
return $number; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub count_numbers { |
45
|
6003
|
|
|
6003
|
1
|
6623
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
6003
|
|
|
|
|
4422
|
return scalar @{$self->{_array}}; |
|
6003
|
|
|
|
|
14019
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_highest_number { |
51
|
2990
|
|
|
2990
|
1
|
11140
|
my ($self, $do_splice) = @_; |
52
|
|
|
|
|
|
|
|
53
|
2990
|
|
|
|
|
2319
|
my $number; |
54
|
2990
|
100
|
|
|
|
3500
|
if ($do_splice) { |
55
|
2988
|
|
|
|
|
2075
|
$number = shift(@{$self->{_array}}); |
|
2988
|
|
|
|
|
3978
|
|
56
|
2988
|
|
|
|
|
4853
|
return $number; |
57
|
|
|
|
|
|
|
} else { |
58
|
2
|
|
|
|
|
9
|
return $self->{_array}->[0]; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub get_label { |
63
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
10
|
return $self->{label}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |