line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Poker::Score::Low8; |
2
|
1
|
|
|
1
|
|
1703
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
3
|
1
|
|
|
1
|
|
614
|
use Algorithm::Combinatorics qw(combinations); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Poker::Score::Low8 - Identify and score lowball 8 or better poker hand. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Version 0.01 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 INTRODUCTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This scoring system is typically used in split-pot games. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
See Poker::Score for code example. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
extends 'Poker::Score'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _build_rank_map { |
30
|
|
|
|
|
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
$self->_rank_map({ |
32
|
|
|
|
|
|
|
'A' => '01', |
33
|
|
|
|
|
|
|
'2' => '02', |
34
|
|
|
|
|
|
|
'3' => '03', |
35
|
|
|
|
|
|
|
'4' => '04', |
36
|
|
|
|
|
|
|
'5' => '05', |
37
|
|
|
|
|
|
|
'6' => '06', |
38
|
|
|
|
|
|
|
'7' => '07', |
39
|
|
|
|
|
|
|
'8' => '08', |
40
|
|
|
|
|
|
|
'9' => '09', |
41
|
|
|
|
|
|
|
'T' => '10', |
42
|
|
|
|
|
|
|
'J' => '11', |
43
|
|
|
|
|
|
|
'Q' => '12', |
44
|
|
|
|
|
|
|
'K' => '13', |
45
|
|
|
|
|
|
|
}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _build_hands { # generates all possible low8 hands |
49
|
|
|
|
|
|
|
my $self = shift; |
50
|
|
|
|
|
|
|
my @scores; |
51
|
|
|
|
|
|
|
my $iter = combinations([1..8], 5); |
52
|
|
|
|
|
|
|
while (my $c = $iter->next) { |
53
|
|
|
|
|
|
|
push( @scores, join( "", map { sprintf("%02d", $_) } sort { $b <=> $a } @$c ) ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
$self->hands([ sort { $b <=> $a } @scores ]); |
56
|
|
|
|
|
|
|
#$self->_hand_map( {} ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Nathaniel Graham, C<< >> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Copyright 2016 Nathaniel Graham. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
68
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
69
|
|
|
|
|
|
|
copy of the full license at: |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
L |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |