Skip to content

Instantly share code, notes, and snippets.

@kaochenlong
Created July 19, 2011 01:42
Show Gist options
  • Save kaochenlong/1091131 to your computer and use it in GitHub Desktop.
Save kaochenlong/1091131 to your computer and use it in GitHub Desktop.
Fibonacci
val = [0,1]
10.times do |n|
puts val[n] ||= val[n-1] + val[n-2]
end
@hSATAC
Copy link

hSATAC commented Jul 19, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment