elliotec / fibonacci_fetch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#fibonacci_fetch

This ruby file creates a method that accepts input n, and returns the nth fibonacci number.

##Usage

Instantiate a new class of Fibonacci with

f = Fibonacci.new

Call the nacci method and pass the argument that is the nth position in the Fibonacci sequence, and print it like

puts f.nacci(1)
puts f.nacci(7)
puts f.nacci(15)

and watch it print whichever numbers you asked it to.

1
13
610

##License

http://elliotec.mit-license.org

About


Languages

Language:Ruby 100.0%