Fibonacci Sequence

I used my instincts to write this fibonacci sequence generator using an array. I’m aware there are simpler solutions not using an array. I used an array because originally I wanted to output the entire array (e.g., [0,1,1,2,3]).

Using Iteration

def fibonacci(input)

  return input if input == 0 || input == 1

  array_of_results = [0,1]
  i = 1
  until i == input
    next_node = array_of_results[-1] + array_of_results[-2]
    i += 1

  return array_of_results.last

p fibonacci(11) #=> returns 89


def fibonacci_recursive(input)
return input if input == 0 || input == 1
fibonacci_recursive(input-1) + fibonacci_recursive(input-2) if input > 1

p fibonacci_recursive(11) #=> returns 89

New Project – Order Management

This project has taken a good amount of effort to complete.


ORDER MANAGEMENT – hosted on Heroku

The purpose of this application is to track client orders and ‘widgets’ (shippable product).

Customer Database

  • CRUD actions available to user

Order Database

  • CRUD actions
  • User can assign widgets to open orders
  • User can track order status

As I add features in the future this post will be updated.

Link to github repository