Skip to content

Instantly share code, notes, and snippets.

@caseyhoward
Created September 15, 2010 23:00
Show Gist options
  • Save caseyhoward/581656 to your computer and use it in GitHub Desktop.
Save caseyhoward/581656 to your computer and use it in GitHub Desktop.
@fib = Hash.new{ |hash, key| hash[key] = hash[key - 1] + hash[key - 2] }
@fib[0] = @fib[1] = 1
puts 0.upto(30).map {|x| @fib[x]}.join(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment