makersacademy/problem-solving

Mastery quizzes Chapter 4 - Question 3

Closed this issue · 4 comments

Fibonacci numbers has me very confused!

Been trying all day to get to the bottom of this but just can't work out how to add the previous two Fibonacci numbers together.

This is my latest (bad attempt) but it just creates an infinite loop..
screen shot 2018-08-14 at 17 43 05

Has anyone had any success on this one?

m-rcd commented

Hey Darcie,
Try to make this simpler on yourself by maybe starting with creating an array with the numbers that the challenge is giving you. Like: array = [0, 1]. start off by just trying to add these two together and then pushing the result into that array. From there you can work on a loop to keep going.
Hope this is helpful, let me know if not!

Hey Marianne

Thanks for the reply :)

Sounds like a good idea to me, what do you mean by pushing the result into the array?

m-rcd commented

I meant like literally the array.push method but you can use whichever appending method you like!

ahh I see ok I'll give that a try and see what happens, thanks!