Branch Coverage

blib/lib/Game/TextMapper/Schroeder/Alpine.pm
Criterion Covered Total %
branch 197 248 79.4


line true false branch
79 0 14 if $altitude->{$coordinates}
98 0 600 unless $current_altitude > 0
102 0 600 if rand() < $n - int($n)
104 0 600 if $n < 1
109 762 7915 unless $self->legal($x, $y)
112 7714 201 if ($altitude->{$other})
114 976 6738 unless $self->legal($x, $y)
117 6353 385 if $altitude->{$other}
120 586 0 $current_altitude > 0 ? :
134 0 600 unless (defined $altitude->{$coordinates})
139 0 0 unless $self->legal($x, $y)
141 0 0 unless defined $altitude->{$other}
146 0 0 unless (defined $altitude->{$coordinates})
175 1 28 if $current_altitude > 10 or $current_altitude < 0
181 28 0 if ($delta < -1 or $delta > 1)
185 21 119 unless $self->legal($x, $y)
188 1 118 if $current_altitude > 10 or $current_altitude < 0
207 0 600 if $altitude->{$coordinates} <= $self->bottom
216 786 2214 if $legal and $altitude->{$other} > $altitude->{$coordinates}
218 86 1890 if $legal and $water->{$other} and $water->{$other} == ($i - 3) % 6
226 1721 2338 unless defined $water->{$next}
230 355 1983 unless $self->legal($x, $y)
234 52 1931 if $loop{$next}
237 214 1277 if (not defined $direction or not $legal and $altitude->{$coordinates} < $lowest or $legal and $altitude->{$other} < $lowest)
240 716 83 $legal ? :
245 585 15 if (defined $direction)
248 585 0 unless $world->{$coordinates} =~ s/arrow\d/arrow$water->{$coordinates}/u
258 21 579 if ($altitude->{$coordinates} >= 10) { }
43 536 elsif ($altitude->{$coordinates} >= 9) { }
119 417 elsif ($altitude->{$coordinates} >= 8) { }
272 0 600 if ($altitude->{$coordinates} <= $self->bottom)
276 0 0 unless $self->legal($x, $y)
278 0 0 if $altitude->{$other} <= $self->bottom
281 0 0 $ocean ? :
291 15 585 if (not defined $water->{$coordinates} and $world->{$coordinates} ne "ocean")
303 53 547 if $world->{$coordinates} =~ /ocean|water|swamp|grass/u
305 328 219 unless $flow->{$coordinates}
307 28 191 if $dry->{$coordinates}
311 32 159 unless $self->legal($x, $y)
314 107 52 if $altitude->{$coordinates} > $altitude->{$other}
316 29 23 if ($altitude->{$coordinates} >= 6) { }
334 0 2 unless @lakes
350 0 146 unless $coordinates
353 133 13 if ($self->legal($coordinates) and $world->{$coordinates} ne "ocean")
358 134 518 if $seen{$to}
371 53 55 if (not defined $water->{$from} or $water->{$from} != $i) { }
376 15 38 unless $world->{$from} =~ s/arrow\d/arrow$i/u
386 13 2 if $start
388 2 11 unless $start
398 42 62 unless $world->{$_} =~ /mountain|swamp|grass|water|ocean/u
406 275 0 if $altitude->{$_} == 7 || $altitude->{$_} == 8 || $world->{$_} =~ /water/u && $altitude->{$_} > $self->bottom and not $flow->{$_}
421 647 93 if (defined $water->{$coordinates}) { }
423 0 647 if grep /$other/u, @$river
425 11 636 if (ref $flow->{$other}) { }
461 23 458 if ($seen{$coordinates})
465 0 23 if (@$canyon)
467 0 0 if ($other[0] eq $canyon->[-1]) { }
474 0 0 if $other ne $coordinates
487 30 428 if ($altitude->{$coordinates} and $current_altitude < $altitude->{$coordinates} and not $world->{$coordinates} =~ /water|ocean/u) { }
491 11 19 unless @$canyon
493 30 0 unless $dry->{$coordinates}
499 11 417 if (@$canyon)
522 0 0 if $flow->{$other}
527 0 0 if $flow->{$other}
535 55 163 unless $world->{$coordinates} =~ /mountain|hill|water|ocean|swamp|grass/u
538 0 218 if rand() < $self->arid - int($self->arid)
541 218 0 if ($n >= 1)
544 90 984 unless $self->legal($x, $y)
546 54 930 if $dry->{$other}
547 323 607 if $altitude->{$coordinates} < $altitude->{$other}
548 266 341 unless $world->{$other} =~ /mountain|hill|water|ocean|swamp|grass/u
551 218 0 if ($n >= 2)
554 310 1838 unless $self->legal($x, $y)
556 1374 464 if $altitude->{$coordinates} <= $altitude->{$other}
560 43 1264 unless $self->legal($mx, $my)
562 129 1135 if $dry->{$midway}
563 671 464 if $self->distance($midway, $other) != 1
564 28 436 if $altitude->{$coordinates} < $altitude->{$midway}
565 26 410 if $altitude->{$midway} < $altitude->{$other}
569 54 410 unless $ok
570 226 184 unless $world->{$other} =~ /mountain|hill|water|ocean|swamp|grass/u
575 125 422 if ($altitude->{$coordinates} >= 7) { }
231 191 elsif ($altitude->{$coordinates} >= 6) { }
157 34 elsif ($altitude->{$coordinates} >= 4) { }
592 30 218 if $dry->{$coordinates}
604 337 263 if $altitude->{$coordinates} < 7 or $altitude->{$coordinates} > 8
608 20 243 unless $self->legal($x, $y)
611 72 171 if $altitude->{$coordinates} > $altitude->{$other}
623 456 144 if $altitude->{$coordinates} != 7
625 3 141 if $world->{$coordinates} =~ /water|ocean/u
629 9 132 unless $self->legal($x, $y)
632 94 38 if $altitude->{$coordinates} > $altitude->{$other}
642 72 528 unless ($world->{$coordinates} =~ /mountain|hill|water|ocean|swamp|grass|forest|firs|trees/u)
643 13 59 if ($altitude->{$coordinates} >= 7) { }
657 13 69 unless $self->legal($x, $y)
669 34 17 unless $world->{$coordinates} =~ s/light-green bushes/light-green grass/u or $world->{$coordinates} =~ s/light-green grass/dust grass/u or $world->{$coordinates} =~ s/dust grass/dust hill/u
680 2 2 if @candidates > $max / 10
684 25 38 unless $world->{$coordinates} =~ s/fir-forest/firs thorp/u
686 52 1748 if $world->{$_} =~ /(?
688 0 4 if @candidates > $max / 20
693 45 1755 if $world->{$_} =~ /(?
695 0 4 if @candidates > $max / 40
702 0 4 if @candidates > $max / 40
709 0 4 if @candidates > $max / 40
718 397 11 unless $world->{$other} and $world->{$other} =~ /water|ocean/u
729 1 87 if $world->{$coordinates} =~ /large-town|city/u
730 3 85 if $world->{$coordinates} =~ / town/u
745 88 3558 if $from eq $to
748 125 117 if ($distance <= 3 and !$best_distance || $distance <= $best_distance and !$best || $altitude->{$to} < $best_altitude)
756 2 86 unless $best
758 14 72 if $trails{"$best-$from"}
771 0 600 if $altitude->{$coordinates} <= $self->bottom
774 238 2762 unless $self->legal($x, $y)
776 121 2641 if ($altitude->{$coordinates} - $altitude->{$other} >= 2)
777 65 56 if (@neighbors == 6) { }
793 62 281 if $seen{$coordinates}
795 31 250 unless exists $altitude->{$coordinates}
796 0 250 if ($altitude->{$coordinates} <= $self->bottom)
797 0 0 if ($altitude->{$coordinates} == $self->bottom and $world->{$coordinates} =~ /water|ocean/u and $altitude->{$coordinates} == $altitude->{$last} - 1) { }
847 0 36 if $step == $i++
857 20 16 if ($step >= 10)
911 0 2 if ($step > 0)
926 0 2 if ($step > 0)
938 2 0 if $url