From: "Jan E." Date: 2012-09-29T20:18:41+09:00 Subject: Re: ibonacci sequence problem Roelof Wobben wrote in post #1077985: > And the best way for me to learn something is to do it and not only to > read about it. Yes, absolutely! And I think my critique was a bit unjust: You've found a valid, logical solution that works fine (apart from the small "inject" mistake). So you've done a good job. What I was talking about is the next step: improving the programming style. When you've found a solution, it's always a good idea to try to improve it and think about alternative approaches. For example, you could ask yourself: Do I really need to save all elements in an array? Or you could look for built-in Ruby methods to solve the task: How can I create a "sequence object"? How can I select all elements up to the first one that doesn't fulfill a condition? etc. I've found this to very helpful in the learning process. Solving a problem is one thing. Digging deep into the language to find a better solution is even better. -- Posted via http://www.ruby-forum.com/.