Branch Coverage

blib/lib/Game/TextMapper/Folkesten.pm
Criterion Covered Total %
branch 88 114 77.1


line true false branch
105 0 1710 unless defined $i
106 1710 0 unless ref $hex
144 1751 0 unless defined $y
145 1550 85 if $x > 0 and $x <= $self->width and $y > 0 and $y <= $self->height
194 0 1 if $edges < 0
197 0 1 if ($edge eq 'west') { }
0 1 elsif ($edge eq 'east') { }
1 0 elsif ($edge eq 'north') { }
0 0 elsif ($edge eq 'south') { }
218 4 33 if ($self->world->{$other} ne "ocean" and rand() < "0.333333333333333")
227 4 20 if $seen{$other}
229 4 16 if ($self->world->{$other} ne "ocean" and rand() < "0.5")
235 26 26 if $self->world->{$_} ne "ocean"
15 3 if (&any(sub { $self->world->{$_} ne "water" if $self->world->{$_} ne "ocean"; } , $self->all_neighbors($hex)))
260 6 1 if ($self->world->{$coord} eq "plain")
269 39 233 if ($self->world->{$other} eq "plain")
270 18 21 if ($chance and rand() < $chance) { }
281 12 105 if ($self->world->{$other} eq "plain")
310 1 23 if $seen{$hex}
318 229 10 unless not $self->legal($_)
319 15 34 if ($end)
327 10 24 if ($seen{$next})
333 3 2 if ($seen{$next}) { }
343 8 2 if (@other > 0)
344 1 7 if ($other[0] eq $next) { }
357 0 2 unless ($next)
385 8 14 unless @$river > 2
390 7 48 if ($seen{$hex})
391 7 0 if (@$canyon == 0) { }
0 0 elsif ($seen{$hex} == 1) { }
0 0 elsif ($seen{$hex} > 1) { }
409 0 48 if ($self->legal($hex) and $self->altitude->{$self->world->{$hex}} > $current_altitude) { }
0 48 elsif (@$canyon > 0) { }
43 5 elsif ($self->legal($hex)) { }
410 0 0 if (@$canyon > 0) { }
442 0 1 rand() < 0.5 ? :
443 1 0 $dir == 1 ? :
444 1 0 $dir == 1 ? :
447 110 0 $dir == 1 ? :
449 8 92 if (not $dry and $self->world->{$hex} eq 'mountain') { }
23 69 elsif ($dry) { }
450 8 0 $dir == 1 ? :
459 11 3 $dry % 2 ? :
14 9 if abs($x - $dry) % 2
461 36 1 if $self->wet->{$hex2}
480 85 15 if $self->world->{$_} ne "water"
483 38 44 if ($self->wet->{$hex} and rand() < "0.5" or not $self->dry->{$hex} || &any(sub { $self->dry->{$_}; } , $self->all_neighbors($hex)) and rand() < "0.166666666666667")
487 6 32 if ($self->world->{$hex} eq 'plain') { }
14 18 elsif ($self->world->{$hex} eq 'hills') { }
498 25 57 if (not $self->dry->{$hex} and &any(sub { $forest_hexes{$_}; } , $self->all_neighbors($hex)) and rand() < "0.333333333333333")
501 5 20 if ($self->world->{$hex} eq 'plain') { }
4 16 elsif ($self->world->{$hex} eq 'hills') { }
518 14 86 if $self->world->{$_} eq "plain"
519 0 1 if &any(sub { $self->dry->{$_}; } , $self->all_neighbors($hex))
520 1 0 if (rand() < "0.166666666666667")
534 85 15 unless $self->world->{$_} eq "water"
535 3 15 if (rand() < "0.166666666666667")