Page 2 of 2

Re: A series of numbers: Help needed

Posted: Mon Mar 23, 2015 12:00 pm
by Nubeat7
does it happen every 4th layer or just this one time from the 4th to the 5th layer..

maybe i would just take the 2^x formula and doing some special case for the 4th layer using some if / then ...

Re: A series of numbers: Help needed

Posted: Tue Mar 24, 2015 7:48 pm
by tulamide
I'm so sorry. You all were right! And it was good that you insisted on the break being irregular. I had a look at my code and for whatever reason I changed the negation "* -1" to "* -2". I guess I changed it between the test of 4 and 5 layers. But I have no clue why I did it. Maybe I was just too tired or something.

My sincerest apologies! To compensate for it I offer that you might choose the topic of Ruby Stripped, Part 3.

Vote for either
- Arrays
- self-calling classes and recursive methods

I hope this is acceptable :)

Re: A series of numbers: Help needed

Posted: Tue Mar 24, 2015 8:16 pm
by KG_is_back
ARRAYS please... especially I need a clear explanation of several methods, namely .each, .each_index, .map, .collect ,etc.
I have trouble understanding what they suppose to do and what are differences between them (I can't get my head around of what they return). Topics I've googled so far are not very clear. And also how to make them iterate over just a segment of array. Also, the way I understand arrays, they only hold pointers to their child objects (not the objects themselves) which causes some unexpected (unintuitive) behaviour when copying and editing nested arrays (similar problem happened to me recently with strings too). Can you give some explanation and show how/when these problems occur and how to fix/prevent them...

Re: A series of numbers: Help needed

Posted: Tue Mar 24, 2015 8:53 pm
by RJHollins
Good to hear you found the bug tulamide ! :)

If I may also request anything on ARRAY's. These are always needed, and understanding better ways to work with them always appreciated !

8-)

Re: A series of numbers: Help needed

Posted: Tue Mar 24, 2015 8:55 pm
by Exo
+1 for Arrays :D