| 1 | package Language::Homespring; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | $VERSION = 0.04; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use Language::Homespring::Node; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use Language::Homespring::Salmon; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Language::Homespring::Snowmelt; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Language::Homespring::River; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 26 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 26 | my $class = shift; | |||||||||||||||||||||||||||
| 15 | 26 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 26 | my $options = shift; | |||||||||||||||||||||||||||
| 18 | 26 | $self->{root_node} = undef; | |||||||||||||||||||||||||||
| 19 | 26 | $self->{salmon} = []; | |||||||||||||||||||||||||||
| 20 | 26 | $self->{snowmelt} = []; | |||||||||||||||||||||||||||
| 21 | 26 | $self->{new_salmon} = []; | |||||||||||||||||||||||||||
| 22 | 26 | $self->{dead_salmon} = []; | |||||||||||||||||||||||||||
| 23 | 26 | $self->{output} = ''; | |||||||||||||||||||||||||||
| 24 | 26 | $self->{universe_ok} = 1; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 26 | return $self; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 26 | ▶ | sub parse { | ||||||||||||||||||||||||||
|
Subroutine
parse: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 26 | my ($self, $source) = @_; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | my @tokens = | ||||||||||||||||||||||||||||
| 33 | 151 | map{s/(\.$)|(^\.)/\n/g; $_} | |||||||||||||||||||||||||||
| 34 | 151 | map{s/\. / /g; $_} | |||||||||||||||||||||||||||
| 35 | 26 | map{s/ \././g; $_} | |||||||||||||||||||||||||||
| 36 | split /(?:(?<!\.) (?!\.))|(?:\n(?!\.))/, $source; | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | #print((join '|', @tokens)."\n\n"); | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 26 | $self->{root_node} = new Language::Homespring::Node({ | |||||||||||||||||||||||||||
| 41 | 'interp' => $self, | ||||||||||||||||||||||||||||
| 42 | 'node_name' => shift @tokens, | ||||||||||||||||||||||||||||
| 43 | }); | ||||||||||||||||||||||||||||
| 44 | 26 | my $parent = $self->{root_node}; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 26 | for my $token(@tokens){ | |||||||||||||||||||||||||||
| 47 | 125 | ▶ | if ($token){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 95 | my $new_node = new Language::Homespring::Node({ | |||||||||||||||||||||||||||
| 49 | 'interp' => $self, | ||||||||||||||||||||||||||||
| 50 | 'node_name' => $token, | ||||||||||||||||||||||||||||
| 51 | 'parent_node' => $parent, | ||||||||||||||||||||||||||||
| 52 | }); | ||||||||||||||||||||||||||||
| 53 | 95 | $parent->add_child($new_node); | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 95 | my $new_river = new Language::Homespring::River({ | |||||||||||||||||||||||||||
| 56 | 'interp' => $self, | ||||||||||||||||||||||||||||
| 57 | 'up_node' => $new_node, | ||||||||||||||||||||||||||||
| 58 | 'down_node' => $parent, | ||||||||||||||||||||||||||||
| 59 | }); | ||||||||||||||||||||||||||||
| 60 | 95 | $parent->add_river_up($new_river); | |||||||||||||||||||||||||||
| 61 | 95 | $new_node->add_river_down($new_river); | |||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 95 | $parent = $new_node; | |||||||||||||||||||||||||||
| 64 | }else{ | ||||||||||||||||||||||||||||
| 65 | 30 | ▶ | if (defined $parent->{parent_node}){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | 30 | $parent = $parent->{parent_node}; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 155 | ▶ | sub tick { | ||||||||||||||||||||||||||
|
Subroutine
tick: called CC=20 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 73 | 155 | my ($self) = @_; | |||||||||||||||||||||||||||
| 74 | 155 | my @nodes; | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 155 | $self->{output} = ''; | |||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | # has our universe been smashed? | ||||||||||||||||||||||||||||
| 79 | 155 | ▶ | return if !$self->{universe_ok}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | # process snowmelts | ||||||||||||||||||||||||||||
| 82 | 151 | @nodes = $self->_get_nodes('snowmelt'); | |||||||||||||||||||||||||||
| 83 | 151 | for (@nodes){ | |||||||||||||||||||||||||||
| 84 | #spawn a new snowmelt | ||||||||||||||||||||||||||||
| 85 | 31 | my $snowmelt = new Language::Homespring::Snowmelt({'interp' => $self, 'location' => $_}); | |||||||||||||||||||||||||||
| 86 | 31 | push @{$self->{snowmelt}}, $snowmelt; | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | 151 | $_->move() for (@{$self->{snowmelt}}); | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | # has our universe been smashed? | ||||||||||||||||||||||||||||
| 91 | 151 | ▶ | return if !$self->{universe_ok}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | # process water | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | # turn everything off | ||||||||||||||||||||||||||||
| 97 | 149 | $self->_set_all('water', 0); | |||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | # water from springs | ||||||||||||||||||||||||||||
| 100 | 149 | @nodes = $self->_get_all_nodes(); | |||||||||||||||||||||||||||
| 101 | 149 | for (@nodes){ | |||||||||||||||||||||||||||
| 102 | 700 | ▶ | $self->_water_downwards($_) if $_->{spring}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | # process electricity | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | # turn everything off | ||||||||||||||||||||||||||||
| 108 | 149 | $self->_set_recurse($self->{root_node}, 'power', 0); | |||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | # process "powers" | ||||||||||||||||||||||||||||
| 111 | 149 | @nodes = $self->_get_nodes('powers'); | |||||||||||||||||||||||||||
| 112 | 149 | for(@nodes){ | |||||||||||||||||||||||||||
| 113 | 116 | ▶ | if (!$_->{destroyed}){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 114 | 110 | $self->_power_downwards($_); | |||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | # process "hydro power" | ||||||||||||||||||||||||||||
| 119 | 149 | @nodes = $self->_get_nodes('hydro power'); | |||||||||||||||||||||||||||
| 120 | 149 | for (@nodes){ | |||||||||||||||||||||||||||
| 121 | 19 | ▶ | $self->_power_downwards($_) if $_->{water} && !$_->{destroyed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$_->{"water"} and not $_->{"destroyed"}
MC/DC100%2/2
$_->{"water"} and not $_->{"destroyed"}
$_->{"water"}
not $_->{"destroyed"}
Truth table100%3/3
A and not(B)
A= $_->{"water"}B= not $_->{"destroyed"}
| |||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | # process "power invert" | ||||||||||||||||||||||||||||
| 125 | 149 | @nodes = $self->_get_nodes('power invert'); | |||||||||||||||||||||||||||
| 126 | 149 | for (@nodes){ | |||||||||||||||||||||||||||
| 127 | 18 | ▶ | $self->_power_downwards($_) if !$_->{power} && !$_->{destroyed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$_->{"power"} or $_->{"destroyed"}
MC/DC100%2/2
$_->{"power"} or $_->{"destroyed"}
$_->{"power"}
$_->{"destroyed"}
Truth table100%3/3
A or B
A= $_->{"power"}B= $_->{"destroyed"}
| |||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | # process salmon | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | 149 | $_->move() for (@{$self->{salmon}}); | |||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | # sort out dead salmon | ||||||||||||||||||||||||||||
| 135 | 149 | @{$self->{salmon}} = grep{ | |||||||||||||||||||||||||||
| 136 | 338 | my $ok = 1; | |||||||||||||||||||||||||||
| 137 | 338 | for my $dead(@{$self->{dead_salmon}}){ | |||||||||||||||||||||||||||
| 138 | 781 | ▶ | $ok = 0 if $_ == $dead; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||
| 140 | 338 | $ok; | |||||||||||||||||||||||||||
| 141 | 149 | }@{$self->{salmon}}; | |||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | # sort out new salmon | ||||||||||||||||||||||||||||
| 144 | 149 | push @{$self->{salmon}}, @{$self->{new_salmon}}; | |||||||||||||||||||||||||||
| 145 | 149 | $self->{new_salmon} = []; | |||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | # process others | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 149 | @nodes = $self->_get_nodes('hatchery'); | |||||||||||||||||||||||||||
| 150 | 149 | for (@nodes){ | |||||||||||||||||||||||||||
| 151 | 149 | ▶ | if ($_->{power}){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 152 | 103 | my $location = @{$_->{rivers_up}}[0]; | |||||||||||||||||||||||||||
| 153 | 103 | my $salmon = new Language::Homespring::Salmon({'interp' => $self,'mature' => 1, 'upstream' => 1, 'location' => $location}); | |||||||||||||||||||||||||||
| 154 | 103 | push @{$self->{salmon}}, $salmon; | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | # @nodes = $self->_get_nodes('bear'); | ||||||||||||||||||||||||||||
| 159 | # for (@nodes){ | ||||||||||||||||||||||||||||
| 160 | # for my $salmon($_->get_salmon()){ | ||||||||||||||||||||||||||||
| 161 | # $salmon->kill() if $salmon->{mature}; | ||||||||||||||||||||||||||||
| 162 | # } | ||||||||||||||||||||||||||||
| 163 | # } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 149 | return $self->{output}; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | 0 | ▶ | sub run{ | ||||||||||||||||||||||||||
|
Subroutine
run: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 169 | 0 | my ($self, $max_ticks, $delimit) = @_; | |||||||||||||||||||||||||||
| 170 | 0 | my $tick = 0; | |||||||||||||||||||||||||||
| 171 | 0 | while(1){ | |||||||||||||||||||||||||||
| 172 | 0 | print $self->tick(); | |||||||||||||||||||||||||||
| 173 | 0 | ▶ | print $delimit if defined($delimit); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | 0 | $tick++; | |||||||||||||||||||||||||||
| 175 | 0 | ▶ | return if (defined($max_ticks) && ($tick >= $max_ticks)); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $max_ticks and $tick >= $max_ticks
MC/DC0%0/2
defined $max_ticks and $tick >= $max_ticks
defined $max_ticks
$tick >= $max_ticks
Truth table0%0/3
A and B
A= defined $max_ticksB= $tick >= $max_ticks
| |||||||||||||||||||||||||||||
| 176 | 0 | ▶ | return if !$self->{universe_ok}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | 149 | ▶ | sub _set_all { | ||||||||||||||||||||||||||
|
Subroutine
_set_all: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 181 | 149 | my ($self, $prop, $value) = @_; | |||||||||||||||||||||||||||
| 182 | 149 | $self->_set_recurse($self->{root_node}, $prop, $value); | |||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | 1400 | ▶ | sub _set_recurse { | ||||||||||||||||||||||||||
|
Subroutine
_set_recurse: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 186 | 1400 | my ($self, $node, $prop, $value) = @_; | |||||||||||||||||||||||||||
| 187 | 1400 | $node->{$prop} = $value; | |||||||||||||||||||||||||||
| 188 | 1400 | $self->_set_recurse($_, $prop, $value) for @{$node->{child_nodes}}; | |||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 747 | ▶ | sub _get_nodes { | ||||||||||||||||||||||||||
|
Subroutine
_get_nodes: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 192 | 747 | my ($self, $name) = @_; | |||||||||||||||||||||||||||
| 193 | 747 | return $self->_get_nodes_i($self->{root_node}, $name); | |||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | 3512 | ▶ | sub _get_nodes_i { | ||||||||||||||||||||||||||
|
Subroutine
_get_nodes_i: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 197 | 3512 | my ($self, $node, $name) = @_; | |||||||||||||||||||||||||||
| 198 | 3512 | my @out = (); | |||||||||||||||||||||||||||
| 199 | 3512 | ▶ | push @out, $node if ($node->{node_name} eq $name); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | 3512 | push @out, $self->_get_nodes_i($_, $name) for @{$node->{child_nodes}}; | |||||||||||||||||||||||||||
| 201 | 3512 | return @out; | |||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 149 | ▶ | sub _get_all_nodes { | ||||||||||||||||||||||||||
|
Subroutine
_get_all_nodes: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 205 | 149 | my ($self) = @_; | |||||||||||||||||||||||||||
| 206 | 149 | return $self->_get_all_nodes_i($self->{root_node}); | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | 700 | ▶ | sub _get_all_nodes_i { | ||||||||||||||||||||||||||
|
Subroutine
_get_all_nodes_i: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 210 | 700 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 211 | 700 | my @out = (); | |||||||||||||||||||||||||||
| 212 | 700 | push @out, $node; | |||||||||||||||||||||||||||
| 213 | 700 | push @out, $self->_get_all_nodes_i($_) for @{$node->{child_nodes}}; | |||||||||||||||||||||||||||
| 214 | 700 | return @out; | |||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | 337 | ▶ | sub _power_downwards { | ||||||||||||||||||||||||||
|
Subroutine
_power_downwards: called CC=7 SCAR=19.7
| |||||||||||||||||||||||||||||
| 218 | 337 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | 337 | ▶ | return if (!$node->{parent_node}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | 234 | $node->{parent_node}->{power} = 1; | |||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | 234 | ▶ | return if ($node->{parent_node}->{node_name} eq 'power invert'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 225 | 229 | ▶ | return if ($node->{parent_node}->{node_name} eq 'insulated'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 226 | 224 | ▶ | return if ($node->{parent_node}->{node_name} eq 'force field'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 227 | 211 | ▶ | return if (($node->{parent_node}->{node_name} eq 'bridge') && ($node->{parent_node}->{destroyed})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$node->{"parent_node"}{"node_name"} eq "bridge" and $node->{"parent_node"}{"destroyed"}
MC/DC0%0/2
$node->{"parent_node"}{"node_name"} eq "bridge" and $node->{"parent_node"}{"destroyed"}
$node->{"parent_node"}{"node_name"} eq "bridge"
$node->{"parent_node"}{"destroyed"}
Truth table33%1/3
A and B
A= $node->{"parent_node"}{"node_name"} eq "bridge"B= $node->{"parent_node"}{"destroyed"}
| |||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | # TODO: "sense" and "switch" | ||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | 211 | $self->_power_downwards($node->{parent_node}); | |||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||
| 234 | 506 | ▶ | sub _water_downwards { | ||||||||||||||||||||||||||
|
Subroutine
_water_downwards: called CC=8 SCAR=22.0
| |||||||||||||||||||||||||||||
| 235 | 506 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||
| 237 | 506 | ▶ | return if (!$node->{parent_node}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | 340 | $node->{parent_node}->{water} = 1; | |||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | 340 | ▶ | return if (($node->{parent_node}->{node_name} eq 'force field') && ($node->{parent_node}->{power})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$node->{"parent_node"}{"node_name"} eq "force field" and $node->{"parent_node"}{"power"}
MC/DC100%2/2
$node->{"parent_node"}{"node_name"} eq "force field" and $node->{"parent_node"}{"power"}
$node->{"parent_node"}{"node_name"} eq "force field"
$node->{"parent_node"}{"power"}
Truth table100%3/3
A and B
A= $node->{"parent_node"}{"node_name"} eq "force field"B= $node->{"parent_node"}{"power"}
| |||||||||||||||||||||||||||||
| 242 | 334 | ▶ | return if (($node->{parent_node}->{node_name} eq 'bridge') && ($node->{parent_node}->{destroyed})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$node->{"parent_node"}{"node_name"} eq "bridge" and $node->{"parent_node"}{"destroyed"}
MC/DC0%0/2
$node->{"parent_node"}{"node_name"} eq "bridge" and $node->{"parent_node"}{"destroyed"}
$node->{"parent_node"}{"node_name"} eq "bridge"
$node->{"parent_node"}{"destroyed"}
Truth table33%1/3
A and B
A= $node->{"parent_node"}{"node_name"} eq "bridge"B= $node->{"parent_node"}{"destroyed"}
| |||||||||||||||||||||||||||||
| 243 | 334 | ▶ | return if (($node->{parent_node}->{node_name} eq 'evaporates') && ($node->{parent_node}->{power})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$node->{"parent_node"}{"node_name"} eq "evaporates" and $node->{"parent_node"}{"power"}
MC/DC0%0/2
$node->{"parent_node"}{"node_name"} eq "evaporates" and $node->{"parent_node"}{"power"}
$node->{"parent_node"}{"node_name"} eq "evaporates"
$node->{"parent_node"}{"power"}
Truth table33%1/3
A and B
A= $node->{"parent_node"}{"node_name"} eq "evaporates"B= $node->{"parent_node"}{"power"}
| |||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | 334 | $self->_water_downwards($node->{parent_node}); | |||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | __END__ | ||||||||||||||||||||||||||||