Game/Omaha.pm

filter: Statementstmt 100% 29 / 29 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 81.6% 40 / 49 CC 4 SCAR 8.6
CC
4
Cov
86%
__ANON__
4.7
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« Game/Holdem.pm ↑ Summary Game/Pineapple.pm »
1 package Poker::Game::Omaha;
2 3 our $VERSION = '0.12';
3  
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Poker::Eval::Omaha;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Poker::Score::High;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 Poker::Game::Omaha - Omaha Hold'em (high only)
14  
15 =head1 VERSION
16  
17 Version 0.12
18  
19 =cut
20  
21  
22 =head1 SYNOPSIS
23  
24 use Poker::Game::Omaha;
25  
26 my $game = Poker::Game::Omaha->new;
27 my $hero = $game->deal_hole(['As', 'Kd', '7c', '2h']); # 4 hole
28 $game->flop(['Ah', 'Kc', '2d']);
29 $game->turn('9s');
30 $game->river('3c');
31 $game->evaluate($hero);
32 say $hero->name;
33  
34 =head1 DESCRIPTION
35  
36 Omaha: four hole cards, five community cards. Best hand uses
37 B<exactly two> hole cards and B<exactly three> community cards.
38 Standard highball ranking.
39  
40 See C<Poker::Game::OmahaHiLo> for the split-pot variant.
41  
42 =cut
43  
44 3 extends 'Poker::Game';
45  
46 2 ▶has '+hole_count' => ( default => sub { 4 } );
Subroutine __ANON__: called CC=1 SCAR=0.0
47 4 ▶has '+board_size' => ( default => sub { 5 } );
Subroutine __ANON__: called CC=1 SCAR=0.0
48  
49 4 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=4 SCAR=15.5
50 4 my ( $orig, $class, @args ) = @_;
51 4 my $args = $class->$orig(@args);
52 4 ▶ $args = {} unless ref $args eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $args eq "HASH" 0 4 4
53  
54 4 ▶ $args->{scorer} //= Poker::Score::High->new;
Condition33%1/3
$args->{"scorer"} //= "Poker::Score::High"->new
l!l&&r!l&&!r
040
MC/DC0%0/2
$args->{"scorer"} //= "Poker::Score::High"->new
$args->{"scorer"} "Poker::Score::High"->new
Truth table33%1/3
A //= B
A= $args->{"scorer"}B= "Poker::Score::High"->new
ABresult
1X1
011
000
55 $args->{eval_engine} //= Poker::Eval::Omaha->new(
56 scorer => $args->{scorer},
57 4 ▶ );
Condition33%1/3
$args->{"eval_engine"} //= "Poker::Eval::Omaha"->new("scorer", $args->{"scorer"})
l!l&&r!l&&!r
040
MC/DC0%0/2
$args->{"eval_engine"} //= "Poker::Eval::Omaha"->new("scorer", $args->{"scorer"})
$args->{"eval_engine"} "Poker::Eval::Omaha"->new("scorer", $args->{"scorer"})
Truth table33%1/3
A //= B
A= $args->{"eval_engine"}B= "Poker::Eval::Omaha"->new("scorer", $args->{"scorer"})
ABresult
1X1
011
000
58  
59 4 return $args;
60 3 };
61  
62 =head1 AUTHOR
63  
64 Nathaniel Graham, C<< <ngraham at cpan.org> >>
65  
66 =head1 LICENSE AND COPYRIGHT
67  
68 Copyright 2016-2026 Nathaniel Graham.
69  
70 =cut
71  
72 3 1;
« Game/Holdem.pm ↑ Summary Game/Pineapple.pm »