Branch Coverage

blib/lib/Game/TextMapper/Schroeder/Alpine.pm
Criterion Covered Total %
branch 218 280 77.8


line true false branch
98 1 28 if $altitude->{$coordinates}
103 28 0 if ($r < $distribution[$i])
125 0 1196 unless $current_altitude > 0
129 0 1196 if rand() < $n - int($n)
131 0 1196 if $n < 1
137 1556 15762 unless $self->legal($x, $y)
140 15300 462 if ($altitude->{$other})
142 1952 13348 unless $self->legal($x, $y)
146 12642 706 if ($altitude->{$other})
147 3839 8803 if $attempt > 4
152 1168 0 $current_altitude > 0 ? :
166 0 1200 unless (defined $altitude->{$coordinates})
171 0 0 unless $self->legal($x, $y)
173 0 0 unless defined $altitude->{$other}
178 0 0 unless (defined $altitude->{$coordinates})
207 2 56 if $current_altitude > 10 or $current_altitude < 0
213 56 0 if ($delta < -1 or $delta > 1)
217 24 256 unless $self->legal($x, $y)
220 2 254 if $current_altitude > 10 or $current_altitude < 0
239 0 1200 if $altitude->{$coordinates} <= $self->bottom
248 1593 4407 if $legal and $altitude->{$other} > $altitude->{$coordinates}
250 258 3673 if $legal and $water->{$other} and $water->{$other} == ($i - 3) % 6
258 3479 3978 unless defined $water->{$next}
262 516 3462 unless $self->legal($x, $y)
266 154 3308 if $loop{$next}
269 402 2435 if (not defined $direction or not $legal and $altitude->{$coordinates} < $lowest or $legal and $altitude->{$other} < $lowest)
272 1425 135 $legal ? :
277 1158 42 if (defined $direction)
280 1158 0 unless $world->{$coordinates} =~ s/arrow\d/arrow$water->{$coordinates}/u
290 39 1161 if ($altitude->{$coordinates} >= 10) { }
97 1064 elsif ($altitude->{$coordinates} >= 9) { }
227 837 elsif ($altitude->{$coordinates} >= 8) { }
304 0 1200 if ($altitude->{$coordinates} <= $self->bottom)
308 0 0 unless $self->legal($x, $y)
310 0 0 if $altitude->{$other} <= $self->bottom
313 0 0 $ocean ? :
323 42 1158 if (not defined $water->{$coordinates} and $world->{$coordinates} ne "ocean")
335 158 1042 if $world->{$coordinates} =~ /ocean|water|swamp|grass/u
337 582 460 unless $flow->{$coordinates}
339 42 418 if $dry->{$coordinates}
343 58 360 unless $self->legal($x, $y)
346 257 103 if $altitude->{$coordinates} > $altitude->{$other}
348 69 34 if ($altitude->{$coordinates} >= 6) { }
366 0 4 unless @lakes
382 0 356 unless $coordinates
385 321 35 if ($self->legal($coordinates) and $world->{$coordinates} ne "ocean")
390 374 1208 if $seen{$to}
403 138 77 if (not defined $water->{$from} or $water->{$from} != $i) { }
408 42 96 unless $world->{$from} =~ s/arrow\d/arrow$i/u
418 38 4 if $start
420 4 31 unless $start
430 104 127 unless $world->{$_} =~ /mountain|swamp|grass|water|ocean/u
438 622 0 if $altitude->{$_} == 7 || $altitude->{$_} == 8 || $world->{$_} =~ /water/u && $altitude->{$_} > $self->bottom and not $flow->{$_}
453 1204 202 if (defined $water->{$coordinates}) { }
455 0 1204 if grep /$other/u, @$river
457 29 1175 if (ref $flow->{$other}) { }
493 57 1021 if ($seen{$coordinates})
497 0 57 if (@$canyon)
499 0 0 if ($other[0] eq $canyon->[-1]) { }
506 0 0 if $other ne $coordinates
519 46 975 if ($altitude->{$coordinates} and $current_altitude < $altitude->{$coordinates} and not $world->{$coordinates} =~ /water|ocean/u) { }
523 21 25 unless @$canyon
525 46 0 unless $dry->{$coordinates}
531 21 954 if (@$canyon)
554 0 0 if $flow->{$other}
559 0 0 if $flow->{$other}
567 119 373 unless $world->{$coordinates} =~ /mountain|hill|water|ocean|swamp|grass/u
570 0 492 if rand() < $self->arid - int($self->arid)
573 492 0 if ($n >= 1)
576 215 2285 unless $self->legal($x, $y)
578 86 2199 if $dry->{$other}
579 710 1489 if $altitude->{$coordinates} < $altitude->{$other}
580 549 940 unless $world->{$other} =~ /mountain|hill|water|ocean|swamp|grass/u
583 492 0 if ($n >= 2)
586 761 4239 unless $self->legal($x, $y)
588 3097 1142 if $altitude->{$coordinates} <= $altitude->{$other}
592 136 3220 unless $self->legal($mx, $my)
594 127 3093 if $dry->{$midway}
595 1926 1167 if $self->distance($midway, $other) != 1
596 70 1097 if $altitude->{$coordinates} < $altitude->{$midway}
597 56 1041 if $altitude->{$midway} < $altitude->{$other}
601 101 1041 unless $ok
602 470 571 unless $world->{$other} =~ /mountain|hill|water|ocean|swamp|grass/u
607 288 850 if ($altitude->{$coordinates} >= 7) { }
579 271 elsif ($altitude->{$coordinates} >= 6) { }
260 11 elsif ($altitude->{$coordinates} >= 4) { }
624 46 492 if $dry->{$coordinates}
636 604 596 if $altitude->{$coordinates} < 7 or $altitude->{$coordinates} > 8
640 22 574 unless $self->legal($x, $y)
643 183 391 if $altitude->{$coordinates} > $altitude->{$other}
655 831 369 if $altitude->{$coordinates} != 7
657 13 356 if $world->{$coordinates} =~ /water|ocean/u
661 27 329 unless $self->legal($x, $y)
664 213 116 if $altitude->{$coordinates} > $altitude->{$other}
674 115 1085 unless ($world->{$coordinates} =~ /mountain|hill|water|ocean|swamp|grass|forest|firs|trees/u)
675 38 77 if ($altitude->{$coordinates} >= 7) { }
688 21 171 unless $self->legal($x, $y)
690 59 112 if $world->{$other} =~ /forest|firs|trees|swamp/u
692 17 1 if ($altitude->{$coordinates} >= 5) { }
1 0 elsif ($altitude->{$coordinates} >= 3) { }
703 17 60 if $self->with_river($rivers, $coordinates)
706 13 96 unless $self->legal($x, $y)
708 56 40 unless $world->{$other} =~ /grass|desert|water/u
710 4 0 if ($altitude->{$coordinates} >= 3) { }
721 17 2931 if grep {$coordinates eq $_;} @$river
733 4 4 if @candidates > $max / 10
737 36 93 unless $world->{$coordinates} =~ s/fir-forest/firs thorp/u
739 64 3536 if $world->{$_} =~ /(?
741 0 8 if @candidates > $max / 20
746 46 3554 if $world->{$_} =~ /(?
748 0 8 if @candidates > $max / 40
755 0 8 if @candidates > $max / 40
762 0 8 if @candidates > $max / 40
771 778 42 unless $world->{$other} and $world->{$other} =~ /water|ocean/u
782 2 179 if $world->{$coordinates} =~ /large-town|city/u
783 9 172 if $world->{$coordinates} =~ / town/u
798 181 7278 if $from eq $to
801 203 177 if ($distance <= 3 and !$best_distance || $distance <= $best_distance and !$best || $altitude->{$to} < $best_altitude)
809 13 168 unless $best
811 34 134 if $trails{"$best-$from"}
824 0 1200 if $altitude->{$coordinates} <= $self->bottom
827 476 5524 unless $self->legal($x, $y)
829 299 5225 if ($altitude->{$coordinates} - $altitude->{$other} >= 2)
830 186 113 if (@neighbors == 6) { }
846 137 609 if $seen{$coordinates}
848 65 544 unless exists $altitude->{$coordinates}
849 0 544 if ($altitude->{$coordinates} <= $self->bottom)
850 0 0 if ($altitude->{$coordinates} == $self->bottom and $world->{$coordinates} =~ /water|ocean/u and $altitude->{$coordinates} == $altitude->{$last} - 1) { }
867 4 0 unless $self->climate eq "desert"
869 0 0 if ($self->with_river($rivers, $coordinates)) { }
871 0 0 unless $world->{$coordinates} =~ s/light-grey/light-green/u
878 0 0 unless $world->{$coordinates} =~ s/light-green bushes/rock bushes/u or $world->{$coordinates} =~ s/light-grey grass/rock bush/u or $world->{$coordinates} =~ s/dark-grey grass/dark-soil bush/u or $world->{$coordinates} =~ s/^grey grass/rock bush/u or $altitude->{$coordinates} >= 4 and $world->{$coordinates} =~ s/light-grey desert/dark-soil desert/u
883 0 0 unless $world->{$coordinates} =~ s/dark-grey swamp2?/light-green bushes/u or $world->{$coordinates} =~ s/^grey swamp2?/light-grey bushes/u or $world->{$coordinates} =~ s/fir-forest/trees/u
923 0 76 if $step == $i++
933 44 32 if ($step >= 10)
960 0 4 shift() ? :
989 0 4 if ($step > 0)
1004 0 4 if ($step > 0)
1016 2 2 if $url
1018 2 2 if wantarray