Skip to content
Browse files

Merge pull request #1 from asiansteev/master

Nice. Much easier to read.

Josh knew of the #{} syntax, but I didn't know how to use it either.
  • Loading branch information...
2 parents a7fddce + 3dbfaef commit cd7ed8e31543cbb3e333c1c7486e2a5ef6896e7a @ashleybot committed May 7, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 Fibonator.rb
View
6 Fibonator.rb
@@ -13,12 +13,10 @@ def GetMeMyNumber(first, second)
i = GetMeMyNumber(first, second)
while i <= 4000000 do
puts i
- if i % 2 == 0
- sum += i
- end
+ sum += i if i.even?
first = second
second = i
i = GetMeMyNumber(first, second)
end
-puts "TOTAL " + sum.to_s
+puts "TOTAL #{sum}"

0 comments on commit cd7ed8e

Please sign in to comment.
Something went wrong with that request. Please try again.