Score/HighSuit.pm

filter: Statementstmt 50.0% 6 / 12 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 36.3% 8 / 22 CC 3 SCAR 22.2
CC
3
Cov
35%
score
12.0
BEGIN
1.0
CRAP 9.2
« Score/Bring/High.pm ↑ Summary Game/CrazyPineapple.pm »
1 package Poker::Score::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::Score::HighSuit - Score highest card of a specific suit.
10  
11 =head1 VERSION
12  
13 Version 0.12
14  
15 =cut
16  
17  
18 =head1 INTRODUCTION
19  
20 Scoring system typically used in split-pot games like High Chicago where half the pot goes to the player holding the highest Spade.
21  
22 =head1 SYNOPSIS
23  
24 See Poker::Score for code example.
25  
26 =cut
27  
28 1 extends 'Poker::Score';
29  
30 0 ▶sub score {
Subroutine score: not called CC=3 SCAR=24.8
Pod documented
31 0 my ( $self, $cards, $suit ) = @_;
32 my ($high_card) =
33 0 sort { $self->rank_val( $b->rank ) <=> $self->rank_val( $a->rank ) }
34 0 ▶ grep { !$_->up_flag && $_->suit eq $suit } @$cards;
Condition0%0/3
!$_->up_flag && $_->suit eq $suit
!ll&&!rl&&r
000
MC/DC0%0/2
!$_->up_flag && $_->suit eq $suit
!$_->up_flag $_->suit eq $suit
Truth table0%0/3
not(A) && B
A= !$_->up_flagB= $_->suit eq $suit
ABresult
0X0
100
111
35  
36 0 ▶ if ($high_card) {
Branch: 1 branch
BranchTrueFalseTotal
if ($high_card) 0 0 0
37 return {
38 0 score => $self->rank_val( $high_card->rank ),
39 hand => [$high_card],
40 };
41 }
42 }
43  
44 1 1;
« Score/Bring/High.pm ↑ Summary Game/CrazyPineapple.pm »