| 1 | package Game::Checkers::Rules; | ||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||
| 3 | 30 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 4 | 30 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use Game::Checkers::Squares; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 7 | 30 | ▶ | use Game::Checkers::Move; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||
| 9 | 30 | our $VERSION = '0.04'; | |||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||
| 11 | # The raw move layout is Move's, so there is one definition of it. These are the | ||||||||||||||||||||||||||||||||||||
| 12 | # names the generator and the search read it by. | ||||||||||||||||||||||||||||||||||||
| 13 | 30 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 14 | 30 | RM_FROM => Game::Checkers::Move::RM_FROM, | |||||||||||||||||||||||||||||||||||
| 15 | RM_TO => Game::Checkers::Move::RM_TO, | ||||||||||||||||||||||||||||||||||||
| 16 | RM_PROMOTED => Game::Checkers::Move::RM_PROMOTED, | ||||||||||||||||||||||||||||||||||||
| 17 | RM_PATH => Game::Checkers::Move::RM_PATH, | ||||||||||||||||||||||||||||||||||||
| 18 | RM_CAPTURES => Game::Checkers::Move::RM_CAPTURES, | ||||||||||||||||||||||||||||||||||||
| 19 | RM_CAPTURED => Game::Checkers::Move::RM_CAPTURED, | ||||||||||||||||||||||||||||||||||||
| 20 | RM_KING => Game::Checkers::Move::RM_KING, | ||||||||||||||||||||||||||||||||||||
| 21 | 30 | }; | |||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||
| 23 | 30 | my $STEP = \@Game::Checkers::Squares::STEP; | |||||||||||||||||||||||||||||||||||
| 24 | 30 | my $JUMP_OVER = \@Game::Checkers::Squares::JUMP_OVER; | |||||||||||||||||||||||||||||||||||
| 25 | 30 | my $JUMP_TO = \@Game::Checkers::Squares::JUMP_TO; | |||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||
| 27 | 30 | my @ALL_DIRS = @Game::Checkers::Squares::DIRS; | |||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||
| 29 | 30 | my %FORWARD = ( | |||||||||||||||||||||||||||||||||||
| 30 | black => [Game::Checkers::Squares::SE, Game::Checkers::Squares::SW], | ||||||||||||||||||||||||||||||||||||
| 31 | white => [Game::Checkers::Squares::NE, Game::Checkers::Squares::NW], | ||||||||||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||
| 34 | 2190307 | ▶ | sub _side { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_side: called CC=5 SCAR=19.2
| |||||||||||||||||||||||||||||||||||||
| 35 | 2190307 | my ($turn) = @_; | |||||||||||||||||||||||||||||||||||
| 36 | die "turn must be black or white, got " . (defined $turn ? "'$turn'" : 'undef') | ||||||||||||||||||||||||||||||||||||
| 37 | 2190307 | ▶ | unless defined $turn && $FORWARD{$turn}; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $turn and $FORWARD{$turn}
MC/DC0%0/2
defined $turn and $FORWARD{$turn}
defined $turn
$FORWARD{$turn}
Truth table33%1/3
A and B
A= defined $turnB= $FORWARD{$turn}
| |||||||||||||||||||||||||||||||||||||
| 38 | 2190307 | ▶ | return ($turn eq 'black' ? 1 : -1, $FORWARD{$turn}); | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||
| 41 | 2186949 | ▶ | sub generate { | ||||||||||||||||||||||||||||||||||
|
Subroutine
generate: called CC=15 SCAR=27.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 42 | 2186949 | my ($position, $turn) = @_; | |||||||||||||||||||||||||||||||||||
| 43 | 2186949 | my ($sign, $forward) = _side($turn); | |||||||||||||||||||||||||||||||||||
| 44 | 2186949 | my (@jumps, @simple); | |||||||||||||||||||||||||||||||||||
| 45 | 2186949 | for my $from (1 .. 32) { | |||||||||||||||||||||||||||||||||||
| 46 | 69982368 | ▶ | my $value = $position->[$from] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 47 | 26384884 | ▶ | next unless ($value > 0 ? 1 : -1) == $sign; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 48 | 12989491 | ▶ | my $king = abs($value) == 2 ? 1 : 0; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 49 | 12989491 | ▶ | my $dirs = $king ? \@ALL_DIRS : $forward; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||
| 51 | # the mover vacates its square for the whole sequence, so a king that | ||||||||||||||||||||||||||||||||||||
| 52 | # jumps in a circle may land back on it | ||||||||||||||||||||||||||||||||||||
| 53 | 12989491 | $position->[$from] = 0; | |||||||||||||||||||||||||||||||||||
| 54 | 12989491 | _walk($position, $from, $sign, $king, $dirs, [$from], [], [], \@jumps); | |||||||||||||||||||||||||||||||||||
| 55 | 12989491 | $position->[$from] = $value; | |||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||
| 57 | 12989491 | ▶ | next if @jumps; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 58 | 10320324 | my $base = $from * 4; | |||||||||||||||||||||||||||||||||||
| 59 | 10320324 | for my $dir (@{$dirs}) { | |||||||||||||||||||||||||||||||||||
| 60 | 24444536 | ▶ | my $to = $STEP->[$base + $dir] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 61 | 20455146 | ▶ | next if $position->[$to]; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 62 | 13807629 | ▶ | push @simple, _raw( | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
not $king and $sign > 0 ? $to >= 29 : $to <= 4
MC/DC100%2/2
not $king and $sign > 0 ? $to >= 29 : $to <= 4
not $king
$sign > 0 ? $to >= 29 : $to <= 4
Truth table100%3/3
not(A) and B
A= not $kingB= $sign > 0 ? $to >= 29 : $to <= 4
| |||||||||||||||||||||||||||||||||||||
| 63 | [$from, $to], [], [], | ||||||||||||||||||||||||||||||||||||
| 64 | (!$king && ($sign > 0 ? $to >= 29 : $to <= 4)) ? 1 : 0, | ||||||||||||||||||||||||||||||||||||
| 65 | $king | ||||||||||||||||||||||||||||||||||||
| 66 | ); | ||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||
| 69 | 2186949 | ▶ | return _sorted(@jumps ? \@jumps : \@simple); | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||
| 72 | 13831909 | ▶ | sub _walk { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_walk: called CC=12 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||
| 73 | 13831909 | my ($position, $square, $sign, $king, $dirs, $path, $captures, $values, $out) = @_; | |||||||||||||||||||||||||||||||||||
| 74 | 13831909 | my $base = $square * 4; | |||||||||||||||||||||||||||||||||||
| 75 | 13831909 | my $found = 0; | |||||||||||||||||||||||||||||||||||
| 76 | 13831909 | for my $dir (@{$dirs}) { | |||||||||||||||||||||||||||||||||||
| 77 | 32623100 | ▶ | my $landing = $JUMP_TO->[$base + $dir] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 78 | 22312301 | ▶ | next if $position->[$landing]; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 79 | 14021509 | my $over = $JUMP_OVER->[$base + $dir]; | |||||||||||||||||||||||||||||||||||
| 80 | 14021509 | ▶ | my $victim = $position->[$over] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 81 | 4710641 | ▶ | next if ($victim > 0 ? 1 : -1) == $sign; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||
| 83 | # a piece jumped may not be jumped twice in one sequence, and it stays | ||||||||||||||||||||||||||||||||||||
| 84 | # on the board until the sequence ends, so it still blocks | ||||||||||||||||||||||||||||||||||||
| 85 | 1129093 | ▶ | next if grep { $_ == $over } @{$captures}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||
| 87 | 902023 | $found = 1; | |||||||||||||||||||||||||||||||||||
| 88 | 902023 | push @{$path}, $landing; | |||||||||||||||||||||||||||||||||||
| 89 | 902023 | push @{$captures}, $over; | |||||||||||||||||||||||||||||||||||
| 90 | 902023 | push @{$values}, $victim; | |||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||
| 92 | 902023 | ▶ | if (!$king && ($sign > 0 ? $landing >= 29 : $landing <= 4)) { | ||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition100%3/3
not $king and $sign > 0 ? $landing >= 29 : $landing <= 4
MC/DC100%2/2
not $king and $sign > 0 ? $landing >= 29 : $landing <= 4
not $king
$sign > 0 ? $landing >= 29 : $landing <= 4
Truth table100%3/3
not(A) and B
A= not $kingB= $sign > 0 ? $landing >= 29 : $landing <= 4
| |||||||||||||||||||||||||||||||||||||
| 93 | # crowning ends the turn, even with another jump available | ||||||||||||||||||||||||||||||||||||
| 94 | 59605 | push @{$out}, _raw($path, $captures, $values, 1, $king); | |||||||||||||||||||||||||||||||||||
| 95 | } elsif (!_walk($position, $landing, $sign, $king, $dirs, $path, $captures, $values, $out)) { | ||||||||||||||||||||||||||||||||||||
| 96 | 725653 | push @{$out}, _raw($path, $captures, $values, 0, $king); | |||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||
| 99 | 902023 | pop @{$path}; | |||||||||||||||||||||||||||||||||||
| 100 | 902023 | pop @{$captures}; | |||||||||||||||||||||||||||||||||||
| 101 | 902023 | pop @{$values}; | |||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||
| 103 | 13831909 | return $found; | |||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||
| 106 | 14592887 | ▶ | sub _raw { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_raw: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 107 | 14592887 | my ($path, $captures, $values, $promoted, $king) = @_; | |||||||||||||||||||||||||||||||||||
| 108 | 14592887 | my @raw; | |||||||||||||||||||||||||||||||||||
| 109 | 14592887 | $raw[RM_FROM] = $path->[0]; | |||||||||||||||||||||||||||||||||||
| 110 | 14592887 | $raw[RM_TO] = $path->[-1]; | |||||||||||||||||||||||||||||||||||
| 111 | 14592887 | $raw[RM_PROMOTED] = $promoted; | |||||||||||||||||||||||||||||||||||
| 112 | 14592887 | $raw[RM_PATH] = [@{$path}]; | |||||||||||||||||||||||||||||||||||
| 113 | 14592887 | $raw[RM_CAPTURES] = [@{$captures}]; | |||||||||||||||||||||||||||||||||||
| 114 | 14592887 | $raw[RM_CAPTURED] = [@{$values}]; | |||||||||||||||||||||||||||||||||||
| 115 | 14592887 | $raw[RM_KING] = $king; | |||||||||||||||||||||||||||||||||||
| 116 | 14592887 | return \@raw; | |||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||
| 119 | 2186949 | ▶ | sub _sorted { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_sorted: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||
| 120 | 2186949 | my ($moves) = @_; | |||||||||||||||||||||||||||||||||||
| 121 | return [ | ||||||||||||||||||||||||||||||||||||
| 122 | sort { | ||||||||||||||||||||||||||||||||||||
| 123 | $a->[RM_FROM] <=> $b->[RM_FROM] | ||||||||||||||||||||||||||||||||||||
| 124 | || $a->[RM_TO] <=> $b->[RM_TO] | ||||||||||||||||||||||||||||||||||||
| 125 | 21387845 | ▶ | || join('.', @{$a->[RM_PATH]}) cmp join('.', @{$b->[RM_PATH]}) | ||||||||||||||||||||||||||||||||||
|
Condition83%5/6
$Game::Checkers::Rules::a->[0] <=> $Game::Checkers::Rules::b->[0] || $Game::Checkers::Rules::a->[1] <=> $Game::Checkers::Rules::b->[1] || join('.', @{$Game::Checkers::Rules::a->[3];}) cmp join('.', @{$Game::Checkers::Rules::b->[3];})
$Game::Checkers::Rules::a->[0] <=> $Game::Checkers::Rules::b->[0] or $Game::Checkers::Rules::a->[1] <=> $Game::Checkers::Rules::b->[1]
MC/DC0%0/3
$Game::Checkers::Rules::a->[0] <=> $Game::Checkers::Rules::b->[0] || $Game::Checkers::Rules::a->[1] <=> $Game::Checkers::Rules::b->[1] || join('.', @{$Game::Checkers::Rules::a->[3];}) cmp join('.', @{$Game::Checkers::Rules::b->[3];})
$Game::Checkers::Rules::a->[0] <=> $Game::Checkers::Rules::b->[0]
$Game::Checkers::Rules::a->[1] <=> $Game::Checkers::Rules::b->[1]
join('.', @{$Game::Checkers::Rules::a->[3];}) cmp join('.', @{$Game::Checkers::Rules::b->[3];})
Truth table75%3/4
A or B || C
A= $Game::Checkers::Rules::a->[0] <=> $Game::Checkers::Rules::b->[0]B= $Game::Checkers::Rules::a->[1] <=> $Game::Checkers::Rules::b->[1]C= join('.', @{$Game::Checkers::Rules::a->[3];}) cmp join('.', @{$Game::Checkers::Rules::b->[3];})
| |||||||||||||||||||||||||||||||||||||
| 126 | 2186949 | } @{$moves} | |||||||||||||||||||||||||||||||||||
| 127 | ]; | ||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||
| 130 | 2331761 | ▶ | sub apply { | ||||||||||||||||||||||||||||||||||
|
Subroutine
apply: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 131 | 2331761 | my ($position, $raw) = @_; | |||||||||||||||||||||||||||||||||||
| 132 | 2331761 | my $from = $raw->[RM_FROM]; | |||||||||||||||||||||||||||||||||||
| 133 | 2331761 | my $value = $position->[$from]; | |||||||||||||||||||||||||||||||||||
| 134 | 2331761 | $position->[$from] = 0; | |||||||||||||||||||||||||||||||||||
| 135 | 2331761 | $position->[$_] = 0 for @{$raw->[RM_CAPTURES]}; | |||||||||||||||||||||||||||||||||||
| 136 | 2331761 | ▶ | $position->[$raw->[RM_TO]] = $raw->[RM_PROMOTED] | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 137 | ? ($value > 0 ? 2 : -2) | ||||||||||||||||||||||||||||||||||||
| 138 | : $value; | ||||||||||||||||||||||||||||||||||||
| 139 | 2331761 | return $raw; | |||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||
| 142 | 2241767 | ▶ | sub unapply { | ||||||||||||||||||||||||||||||||||
|
Subroutine
unapply: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 143 | 2241767 | my ($position, $raw) = @_; | |||||||||||||||||||||||||||||||||||
| 144 | 2241767 | my $to = $raw->[RM_TO]; | |||||||||||||||||||||||||||||||||||
| 145 | 2241767 | my $value = $position->[$to]; | |||||||||||||||||||||||||||||||||||
| 146 | 2241767 | ▶ | $value = $value > 0 ? 1 : -1 if $raw->[RM_PROMOTED]; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 147 | 2241767 | $position->[$to] = 0; | |||||||||||||||||||||||||||||||||||
| 148 | 2241767 | $position->[$raw->[RM_FROM]] = $value; | |||||||||||||||||||||||||||||||||||
| 149 | 2241767 | my $captures = $raw->[RM_CAPTURES]; | |||||||||||||||||||||||||||||||||||
| 150 | 2241767 | my $values = $raw->[RM_CAPTURED]; | |||||||||||||||||||||||||||||||||||
| 151 | 2241767 | $position->[$captures->[$_]] = $values->[$_] for 0 .. $#{$captures}; | |||||||||||||||||||||||||||||||||||
| 152 | 2241767 | return $raw; | |||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||
| 155 | 3358 | ▶ | sub has_move { | ||||||||||||||||||||||||||||||||||
|
Subroutine
has_move: called CC=14 SCAR=26.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 156 | 3358 | my ($position, $turn) = @_; | |||||||||||||||||||||||||||||||||||
| 157 | 3358 | my ($sign, $forward) = _side($turn); | |||||||||||||||||||||||||||||||||||
| 158 | 3358 | for my $from (1 .. 32) { | |||||||||||||||||||||||||||||||||||
| 159 | 30836 | ▶ | my $value = $position->[$from] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 160 | 13971 | ▶ | next unless ($value > 0 ? 1 : -1) == $sign; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 161 | 6162 | ▶ | my $dirs = abs($value) == 2 ? \@ALL_DIRS : $forward; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 162 | 6162 | my $base = $from * 4; | |||||||||||||||||||||||||||||||||||
| 163 | 6162 | for my $dir (@{$dirs}) { | |||||||||||||||||||||||||||||||||||
| 164 | 10521 | my $step = $STEP->[$base + $dir]; | |||||||||||||||||||||||||||||||||||
| 165 | 10521 | ▶ | return 1 if $step && !$position->[$step]; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$step and not $position->[$step]
MC/DC100%2/2
$step and not $position->[$step]
$step
not $position->[$step]
Truth table100%3/3
A and not(B)
A= $stepB= not $position->[$step]
| |||||||||||||||||||||||||||||||||||||
| 166 | 7254 | ▶ | my $landing = $JUMP_TO->[$base + $dir] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 167 | 4552 | ▶ | next if $position->[$landing]; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 168 | 2040 | ▶ | my $victim = $position->[$JUMP_OVER->[$base + $dir]] or next; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 169 | 2040 | ▶ | return 1 if ($victim > 0 ? 1 : -1) != $sign; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||
| 172 | 24 | return 0; | |||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||
| 175 | 2231504 | ▶ | sub progress { | ||||||||||||||||||||||||||||||||||
|
Subroutine
progress: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 176 | 2231504 | my ($raw) = @_; | |||||||||||||||||||||||||||||||||||
| 177 | 2231504 | ▶ | return 1 if @{$raw->[RM_CAPTURES]}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 178 | 1541164 | ▶ | return $raw->[RM_KING] ? 0 : 1; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||
| 181 | 30 | 1; | |||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||
| 183 | __END__ | ||||||||||||||||||||||||||||||||||||