| 1 | package Game::Mahjong::Notation; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 34 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 34 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 34 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 34 | ▶ | use Game::Mahjong::Tiles; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 34 | my %HONOUR = ( | |||||||||||||||||||||||||||||||||||||||||
| 12 | E => 'we', S => 'ws', W => 'ww', N => 'wn', | ||||||||||||||||||||||||||||||||||||||||||
| 13 | R => 'dr', G => 'dg', B => 'dw', | ||||||||||||||||||||||||||||||||||||||||||
| 14 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 34 | my %LETTER_OF = reverse %HONOUR; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 34 | my %MELD = map { $_ => 1 } qw(chow pung kong ckong); | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 71 | ▶ | sub parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 71 | my ($string) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 71 | ▶ | die 'Game::Mahjong::Notation: nothing to parse' unless defined $string; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 70 | my @ids; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 70 | for my $token (split ' ', $string) { | |||||||||||||||||||||||||||||||||||||||||
| 25 | 164 | push @ids, _parse_token($token); | |||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 64 | my %count; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 64 | for my $id (@ids) { | |||||||||||||||||||||||||||||||||||||||||
| 30 | die 'Game::Mahjong::Notation: more than four of ' . Game::Mahjong::Tiles::code_of($id) | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 394 | ▶ | if ++$count{$id} > Game::Mahjong::Tiles::PER_KIND; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | die 'Game::Mahjong::Notation: more than one ' . Game::Mahjong::Tiles::code_of($id) | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 392 | ▶ | if Game::Mahjong::Tiles::is_bonus($id) && $count{$id} > 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
Game::Mahjong::Tiles::is_bonus($id) and $count{$id} > 1
MC/DC100%2/2
Game::Mahjong::Tiles::is_bonus($id) and $count{$id} > 1
Game::Mahjong::Tiles::is_bonus($id)
$count{$id} > 1
Truth table100%3/3
A and B
A= Game::Mahjong::Tiles::is_bonus($id)B= $count{$id} > 1
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 61 | return @ids; | |||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 3493 | ▶ | sub _parse_token { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_token: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 3493 | my ($token) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 3493 | ▶ | if ($token =~ /\A([1-9]+)([mps])\z/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 2828 | my ($ranks, $suit) = ($1, $2); | |||||||||||||||||||||||||||||||||||||||||
| 43 | 2828 | return map { Game::Mahjong::Tiles::id_of($suit . $_) } split //, $ranks; | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 665 | ▶ | if ($token =~ /\A[ESWNRGB]+\z/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 629 | return map { Game::Mahjong::Tiles::id_of($HONOUR{$_}) } split //, $token; | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 36 | ▶ | if ($token =~ /\A([FT])([1-4])\z/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 30 | return Game::Mahjong::Tiles::id_of(lc($1) . $2); | |||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 6 | die "Game::Mahjong::Notation: '$token' is not a tile"; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 593 | ▶ | sub parse_hand { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_hand: called CC=14 SCAR=26.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 593 | my ($string) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 593 | ▶ | die 'Game::Mahjong::Notation: nothing to parse' unless defined $string; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | 593 | my @tokens; | |||||||||||||||||||||||||||||||||||||||||
| 59 | 593 | ▶ | while ($string =~ /\G\s*(\w+\([^)]*\)|\S+)/g) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 3329 | push @tokens, $1; | |||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 593 | my (@concealed, @melds, @flowers); | |||||||||||||||||||||||||||||||||||||||||
| 64 | 593 | for my $token (@tokens) { | |||||||||||||||||||||||||||||||||||||||||
| 65 | 3329 | ▶ | if ($token =~ /\A(\w+)\((.*)\)\z/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 126 | my ($kind, $inside) = ($1, $2); | |||||||||||||||||||||||||||||||||||||||||
| 67 | 126 | ▶ | die "Game::Mahjong::Notation: '$kind' is not a meld" unless $MELD{$kind}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | 125 | my @tiles = map { _parse_token($_) } split ' ', $inside; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 125 | _check_meld($kind, \@tiles); | |||||||||||||||||||||||||||||||||||||||||
| 70 | push @melds, { | ||||||||||||||||||||||||||||||||||||||||||
| 71 | kind => $kind eq 'ckong' ? 'kong' : $kind, | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 118 | ▶ | tiles => [ sort { $a <=> $b } @tiles ], | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | concealed => $kind eq 'ckong' ? 1 : 0, | ||||||||||||||||||||||||||||||||||||||||||
| 74 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 118 | next; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 3203 | for my $id (_parse_token($token)) { | |||||||||||||||||||||||||||||||||||||||||
| 78 | 7364 | ▶ | if (Game::Mahjong::Tiles::is_bonus($id)) { push @flowers, $id } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 7361 | else { push @concealed, $id } | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 585 | my %count; | |||||||||||||||||||||||||||||||||||||||||
| 84 | 585 | for my $id (@concealed, @flowers, map { @{ $_->{tiles} } } @melds) { | |||||||||||||||||||||||||||||||||||||||||
| 85 | die 'Game::Mahjong::Notation: more than four of ' . Game::Mahjong::Tiles::code_of($id) | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 7773 | ▶ | if ++$count{$id} > Game::Mahjong::Tiles::PER_KIND; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | die 'Game::Mahjong::Notation: more than one ' . Game::Mahjong::Tiles::code_of($id) | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 7772 | ▶ | if Game::Mahjong::Tiles::is_bonus($id) && $count{$id} > 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
Game::Mahjong::Tiles::is_bonus($id) and $count{$id} > 1
MC/DC0%0/2
Game::Mahjong::Tiles::is_bonus($id) and $count{$id} > 1
Game::Mahjong::Tiles::is_bonus($id)
$count{$id} > 1
Truth table66%2/3
A and B
A= Game::Mahjong::Tiles::is_bonus($id)B= $count{$id} > 1
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | return { | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 16089 | concealed => [ sort { $a <=> $b } @concealed ], | |||||||||||||||||||||||||||||||||||||||||
| 93 | melds => \@melds, | ||||||||||||||||||||||||||||||||||||||||||
| 94 | 584 | flowers => [ sort { $a <=> $b } @flowers ], | |||||||||||||||||||||||||||||||||||||||||
| 95 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 125 | ▶ | sub _check_meld { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_meld: called CC=13 SCAR=25.7
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 125 | my ($kind, $tiles) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 100 | 125 | my $n = @$tiles; | |||||||||||||||||||||||||||||||||||||||||
| 101 | 125 | ▶ | my $want = $kind eq 'chow' ? 3 : $kind eq 'pung' ? 3 : 4; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 125 | ▶ | die "Game::Mahjong::Notation: a $kind is $want tiles, not $n" unless $n == $want; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 122 | ▶ | if ($kind eq 'chow') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 14 | my @sorted = sort { $a <=> $b } @$tiles; | |||||||||||||||||||||||||||||||||||||||||
| 106 | 14 | my $suit = Game::Mahjong::Tiles::suit_of($sorted[0]); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 14 | ▶ | die 'Game::Mahjong::Notation: a chow is three suit tiles' unless defined $suit; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 13 | for my $i (0, 1) { | |||||||||||||||||||||||||||||||||||||||||
| 109 | 25 | ▶ | die 'Game::Mahjong::Notation: a chow is three consecutive tiles of one suit' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$sorted[$i + 1] == $sorted[$i] + 1 and defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) and Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) eq $suit
$sorted[$i + 1] == $sorted[$i] + 1 and defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1])
MC/DC66%2/3
$sorted[$i + 1] == $sorted[$i] + 1 and defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) and Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) eq $suit
$sorted[$i + 1] == $sorted[$i] + 1
defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1])
Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) eq $suit
Truth table75%3/4
A and B and C
A= $sorted[$i + 1] == $sorted[$i] + 1B= defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1])C= Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) eq $suit
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | unless ($sorted[$i + 1] == $sorted[$i] + 1) | ||||||||||||||||||||||||||||||||||||||||||
| 111 | && defined Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) | ||||||||||||||||||||||||||||||||||||||||||
| 112 | && Game::Mahjong::Tiles::suit_of($sorted[$i + 1]) eq $suit; | ||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 11 | return; | |||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 108 | for my $id (@$tiles) { | |||||||||||||||||||||||||||||||||||||||||
| 117 | 379 | ▶ | die "Game::Mahjong::Notation: a $kind is identical tiles" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | unless $id == $tiles->[0]; | ||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||
| 120 | 107 | ▶ | die 'Game::Mahjong::Notation: a bonus tile is never in a meld' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | if Game::Mahjong::Tiles::is_bonus($tiles->[0]); | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 107 | return; | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 43990 | ▶ | sub print { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 43990 | my (@ids) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 127 | 43990 | my %by_suit; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 43990 | my (@honours, @bonus); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 43990 | for my $id (sort { $a <=> $b } @ids) { | |||||||||||||||||||||||||||||||||||||||||
| 130 | 44933 | Game::Mahjong::Tiles::code_of($id); | |||||||||||||||||||||||||||||||||||||||||
| 131 | 44933 | ▶ | if (my $suit = Game::Mahjong::Tiles::suit_of($id)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 37759 | $by_suit{$suit} .= Game::Mahjong::Tiles::rank_of($id); | |||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | elsif (Game::Mahjong::Tiles::is_honour($id)) { | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 1506 | push @honours, $LETTER_OF{ Game::Mahjong::Tiles::code_of($id) }; | |||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||
| 137 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 5668 | push @bonus, uc Game::Mahjong::Tiles::code_of($id); | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | 43990 | my @tokens; | |||||||||||||||||||||||||||||||||||||||||
| 142 | 43990 | for my $suit (qw(m p s)) { | |||||||||||||||||||||||||||||||||||||||||
| 143 | 131970 | ▶ | push @tokens, $by_suit{$suit} . $suit if defined $by_suit{$suit}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 43990 | ▶ | push @tokens, join('', @honours) if @honours; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 43990 | push @tokens, @bonus; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 43990 | return join ' ', @tokens; | |||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | 31 | ▶ | sub print_meld { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print_meld: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 151 | 31 | my ($meld) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 152 | 31 | my $kind = $meld->{kind}; | |||||||||||||||||||||||||||||||||||||||||
| 153 | 31 | ▶ | $kind = 'ckong' if $kind eq 'kong' && $meld->{concealed}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$kind eq "kong" and $meld->{"concealed"}
MC/DC100%2/2
$kind eq "kong" and $meld->{"concealed"}
$kind eq "kong"
$meld->{"concealed"}
Truth table100%3/3
A and B
A= $kind eq "kong"B= $meld->{"concealed"}
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | 31 | return $kind . '(' . Game::Mahjong::Notation::print(@{ $meld->{tiles} }) . ')'; | |||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | 38 | ▶ | sub print_hand { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print_hand: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | 38 | my ($hand) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 159 | 38 | my @parts; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 38 | ▶ | my $concealed = Game::Mahjong::Notation::print(@{ $hand->{concealed} || [] }); | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$hand->{'concealed'} || []
MC/DC100%1/1
$hand->{'concealed'} || []
$hand->{'concealed'}
Truth table100%2/2
A
A= $hand->{'concealed'}
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 38 | ▶ | push @parts, $concealed if length $concealed; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 38 | ▶ | push @parts, map { print_meld($_) } @{ $hand->{melds} || [] }; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$hand->{'melds'} || []
MC/DC0%0/1
$hand->{'melds'} || []
$hand->{'melds'}
Truth table50%1/2
A
A= $hand->{'melds'}
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | 38 | ▶ | my $flowers = Game::Mahjong::Notation::print(@{ $hand->{flowers} || [] }); | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$hand->{'flowers'} || []
MC/DC100%1/1
$hand->{'flowers'} || []
$hand->{'flowers'}
Truth table100%2/2
A
A= $hand->{'flowers'}
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 38 | ▶ | push @parts, $flowers if length $flowers; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 38 | return join ' ', @parts; | |||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | 1 | ▶ | sub letters { return { %HONOUR } } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
letters: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 34 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | __END__ | ||||||||||||||||||||||||||||||||||||||||||