Eval/HighSuit.pm

filter: Statementstmt 58.3% 7 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 100% 1 / 1 totaltotal 56.2% 9 / 16 CC 1 SCAR 5.1
CC
1
Cov
58%
_build_high_suit
2.0
best_hand
2.0
BEGIN
1.0
CRAP 1.7
« Score/Badugi.pm ↑ Summary Game/Courcheval.pm »
1 package Poker::Eval::HighSuit;
2 1 our $VERSION = '0.12';
3  
4  
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Poker::Eval::HighSuit - Calculate the highest card of a specific suit.
10  
11 =head1 VERSION
12  
13 Version 0.12
14  
15 =cut
16  
17  
18  
19 =head1 INTRODUCTION
20  
21 Useful in split-pot games like High Chicago where half the pot goes to the player with the highest Spade.
22  
23 =cut
24  
25 1 extends 'Poker::Eval';
26  
27 1 has 'high_suit' => (
28 is => 'rw',
29 builder => '_build_high_suit',
30 );
31  
32 0 ▶sub _build_high_suit { # High Chicago
Subroutine _build_high_suit: not called CC=1 SCAR=6.9
33 0 return 's';
34 }
35  
36 0 ▶sub best_hand {
Subroutine best_hand: not called CC=1 SCAR=6.9
Pod documented
37 0 my ( $self, $hole ) = @_;
38 0 my $hand = Poker::Hand->new(cards => $hole);
39 0 $hand->score($self->scorer->score($hole, $self->high_suit));
40 0 return $hand;
41 }
42  
43 =head1 AUTHOR
44  
45 Nathaniel Graham, C<< <ngraham at cpan.org> >>
46  
47 =head1 LICENSE AND COPYRIGHT
48  
49 Copyright 2016 Nathaniel Graham.
50  
51 This program is free software; you can redistribute it and/or modify it
52 under the terms of the the Artistic License (2.0). You may obtain a
53 copy of the full license at:
54  
55 L<http://www.perlfoundation.org/artistic_license_2_0>
56  
57 =cut
58  
59 1 1;
« Score/Badugi.pm ↑ Summary Game/Courcheval.pm »