File Coverage

blib/lib/Poker/Eval/Bitch.pm
Criterion Covered Total %
statement 3 11 27.2
branch 0 2 0.0
condition n/a
subroutine 1 3 33.3
pod n/a
total 4 16 25.0


line stmt bran cond sub pod time code
1             package Poker::Eval::Bitch;
2 1     1   1214 use Moo;
  1         2  
  1         6  
3              
4             =head1 NAME
5              
6             Poker::Eval::Bitch - Evaluate and score hole cards in the game of Bitch.
7              
8             =head1 VERSION
9              
10             Version 0.02
11              
12             =cut
13              
14             our $VERSION = '0.02';
15              
16              
17             =head1 INTRODUCTION
18              
19             "The Bitch" typically refers to the Queen of Spades. Half the pot goes to the player holding the bitch at the end of the game. It's a poker game, folks, so don't get all politically correct on me.
20              
21             =head1 SYNOPSIS
22              
23             See Poker::Eval for example code.
24              
25             =cut
26              
27             extends 'Poker::Eval';
28              
29             has 'bitch_card' => (
30             is => 'rw',
31             builder => '_build_bitch_card',
32             );
33              
34             sub _build_bitch_card { # The Bitch
35 0     0     return 'Qs';
36             }
37              
38             sub best_hand {
39 0     0     my ( $self, $hole ) = @_;
40 0           my $hand = Poker::Hand->new(cards => $hole);
41 0           for my $card (@$hole) {
42 0 0         if ($card->rank . $card->suit eq $self->bitch_card) {
43 0           $hand->score(100);
44 0           return $hand;
45             }
46             }
47 0           return $hand;
48             }
49              
50             =head1 AUTHOR
51              
52             Nathaniel Graham, C<< >>
53              
54             =head1 LICENSE AND COPYRIGHT
55              
56             Copyright 2016 Nathaniel Graham.
57              
58             This program is free software; you can redistribute it and/or modify it
59             under the terms of the the Artistic License (2.0). You may obtain a
60             copy of the full license at:
61              
62             L
63              
64             =cut
65              
66             1;