I have put up my own separate mini blog diyhackerschool.com just to document some of the things I have worked on and some of the things I continue to work on.
Part of that is challenging my self. I have started working on Question 2 of Projecteuler.com
here is what I have after my first brute force attempt: The rest of these will go on my new miniblog diyhackerschool.com
=begin
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
=end
def fibo(max)
fib1 = 0
fib2 = 1
sum =0
fibnum=0
while fib2 < max
if fib2 % 2 == 0
sum += fib2
end
fibnum = fib2 + fib1
fib1 = fib2
fib2 = fibnum
end
puts sum
end
Google+ 