Skip to content

Instantly share code, notes, and snippets.

@yanks
Created May 24, 2012 18:32
Show Gist options
  • Save yanks/2783341 to your computer and use it in GitHub Desktop.
Save yanks/2783341 to your computer and use it in GitHub Desktop.
prev = 1
current = 1
sum = 0
while( current < 4000000 )
tmp = current
current+=prev
prev = tmp
if current % 2 == 0 then
sum += current
end
end
puts sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment