| 1 | package Poker::Game::Pineapple; | ||||||||||||||||||||
| 2 | 1 | our $VERSION = '0.12'; | |||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Poker::Eval::Community; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use Poker::Score::High; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | =head1 NAME | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | Poker::Game::Pineapple - Pineapple Hold'em | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | =head1 VERSION | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | Version 0.12 | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | =cut | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | =head1 SYNOPSIS | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | use Poker::Game::Pineapple; | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | my $game = Poker::Game::Pineapple->new; | ||||||||||||||||||||
| 27 | my $hero = $game->deal_hole(['As', 'Kd', '7c']); # 3 hole cards | ||||||||||||||||||||
| 28 | $game->flop(['Ah', 'Kc', '2d']); | ||||||||||||||||||||
| 29 | $game->turn('9s'); | ||||||||||||||||||||
| 30 | $game->river('3c'); | ||||||||||||||||||||
| 31 | $game->evaluate($hero); | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | =head1 DESCRIPTION | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | Pineapple: three hole cards, five community cards. Any combination of | ||||||||||||||||||||
| 36 | hole and community cards may be used (same as Hold'em). Players typically | ||||||||||||||||||||
| 37 | discard down to two hole cards before the flop in live play; this module | ||||||||||||||||||||
| 38 | models the card math only -- discard timing is left to the caller (or use | ||||||||||||||||||||
| 39 | C<Poker::Game::CrazyPineapple> for post-flop discard). | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | =cut | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 1 | extends 'Poker::Game'; | |||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 1 | ▶ | has '+hole_count' => ( default => sub { 3 } ); | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 46 | 1 | ▶ | has '+board_size' => ( default => sub { 5 } ); | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 1 | ▶ | around BUILDARGS => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=15.5
| |||||||||||||||||||||
| 49 | 1 | my ( $orig, $class, @args ) = @_; | |||||||||||||||||||
| 50 | 1 | my $args = $class->$orig(@args); | |||||||||||||||||||
| 51 | 1 | ▶ | $args = {} unless ref $args eq 'HASH'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 1 | ▶ | $args->{scorer} //= Poker::Score::High->new; | ||||||||||||||||||
|
Condition33%1/3
$args->{"scorer"} //= "Poker::Score::High"->new
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
| |||||||||||||||||||||
| 54 | $args->{eval_engine} //= Poker::Eval::Community->new( | ||||||||||||||||||||
| 55 | scorer => $args->{scorer}, | ||||||||||||||||||||
| 56 | 1 | ▶ | ); | ||||||||||||||||||
|
Condition33%1/3
$args->{"eval_engine"} //= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
MC/DC0%0/2
$args->{"eval_engine"} //= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
$args->{"eval_engine"}
"Poker::Eval::Community"->new("scorer", $args->{"scorer"})
Truth table33%1/3
A //= B
A= $args->{"eval_engine"}B= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
| |||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 1 | return $args; | |||||||||||||||||||
| 59 | 1 | }; | |||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | =head1 AUTHOR | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | Nathaniel Graham, C<< <ngraham at cpan.org> >> | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | Copyright 2016-2026 Nathaniel Graham. | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | =cut | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 1 | 1; | |||||||||||||||||||