Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

palindromes #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

palindromes #8

wants to merge 1 commit into from

Conversation

DStorck
Copy link
Member

@DStorck DStorck commented May 3, 2016

No description provided.

end

def fib(n)
return 1 if n == 1 || n == 2
return fib(n-1) + fib(n-2)
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the zeroth number in the Fibonacci sequence? What happens when this function is called for fib(0)? Otherwise, good solution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crystal and Jeremy keep modeling all their code after a Fibonacci sequence that starts with 1 1 2 3 5 ...which as a math teacher is a little odd , but I guess I could have added in some code to deal with users putting in bad data of any kind.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's not a huge deal, and your implementation passes all the tests. Just something to think about!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants