Skip to content

Commit fccc55d

Browse files
committed
chapter06 Split Temporary Variable #5
example with split temporary variable second assignment of the temp
1 parent 9fd87c0 commit fccc55d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapter06/example_split_temporary_variable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def distance_traveled(time)
66
secondary_time = time - @delay
77
if (secondary_time > 0)
88
primary_vel = primary_acc * @delay
9-
acc = (@prmary_force + @secondary_force) / @mass
10-
result += primary_vel * secondary_time + 5 * acc * secondary_time * secondary_time
9+
secondary_acc = (@prmary_force + @secondary_force) / @mass
10+
result += primary_vel * secondary_time + 5 * secondary_acc * secondary_time * secondary_time
1111
end
1212
result
1313
end

0 commit comments

Comments
 (0)