Eval/BlackMariah.pm

filter: Statementstmt 46.6% 7 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 100% 1 / 1 totaltotal 42.8% 9 / 21 CC 3 SCAR 20.5
CC
3
Cov
41%
best_hand
12.0
_build_bitch_card
2.0
BEGIN
1.0
CRAP 7.8
« Game/CrazyPineapple.pm ↑ Summary Game/Low27SingleDraw.pm »
1 package Poker::Eval::BlackMariah;
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::BlackMariah - Evaluate and score hole cards in the game of Black Mariah.
10  
11 =head1 VERSION
12  
13 Version 0.12
14  
15 =cut
16  
17  
18  
19 =head1 INTRODUCTION
20  
21 "BlackMariah" typically refers to the Queen of Spades. Half the pot goes to the player holding black mariah at the end of the game.
22  
23 =head1 SYNOPSIS
24  
25 See Poker::Eval for example code.
26  
27 =cut
28  
29 1 extends 'Poker::Eval';
30  
31 1 has 'bitch_card' => (
32 is => 'rw',
33 builder => '_build_bitch_card',
34 );
35  
36 0 ▶sub _build_bitch_card { # The Bitch
Subroutine _build_bitch_card: not called CC=1 SCAR=6.9
37 0 return 'Qs';
38 }
39  
40 0 ▶sub best_hand {
Subroutine best_hand: not called CC=3 SCAR=24.8
Pod documented
41 0 my ( $self, $hole ) = @_;
42 0 my $hand = Poker::Hand->new(cards => $hole);
43 0 for my $card (@$hole) {
44 0 ▶ if ($card->rank . $card->suit eq $self->bitch_card) {
Branch: 1 branch
BranchTrueFalseTotal
if ($card->rank . $card->suit eq $self->bitch_card) 0 0 0
45 0 $hand->score(100);
46 0 return $hand;
47 }
48 }
49 0 return $hand;
50 }
51  
52 =head1 AUTHOR
53  
54 Nathaniel Graham, C<< <ngraham at cpan.org> >>
55  
56 =head1 LICENSE AND COPYRIGHT
57  
58 Copyright 2016 Nathaniel Graham.
59  
60 This program is free software; you can redistribute it and/or modify it
61 under the terms of the the Artistic License (2.0). You may obtain a
62 copy of the full license at:
63  
64 L<http://www.perlfoundation.org/artistic_license_2_0>
65  
66 =cut
67  
68 1 1;
« Game/CrazyPineapple.pm ↑ Summary Game/Low27SingleDraw.pm »