Skip to content

Instantly share code, notes, and snippets.

@zschallz
Created July 8, 2012 17:59
Show Gist options
  • Save zschallz/3072063 to your computer and use it in GitHub Desktop.
Save zschallz/3072063 to your computer and use it in GitHub Desktop.
Project Euler problem 2
i = 1
last = 0
sum = 0
begin
temp_last, i = i, (i + last)
if i % 2 == 0 then
sum += i;
end
last = temp_last
end while i < 4000000
print "Answer is " + sum.to_s + "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment