Re: Recursion help.
- From: "JeremyWoertink@xxxxxxxxx" <JeremyWoertink@xxxxxxxxx>
- Date: Thu, 15 Nov 2007 18:16:04 -0500
oh, I thought it was just where you have an iteration inside another
iteration or like nested loops or something. Hmm. Thanks for the help.
I tried your version of the program. It seems to go into an endless
loop, or just takes a REALLY long time. I stopped it after 30
seconds.
Honestly, I don't really understand a whole lot of this. I just kind
of throw things together until they work, but I am getting a lot
better at understanding, which is why I like to see if people can make
my program better. I can then ask why they did the things they do.
So, I see why you would use "w" and not "w+", but why do you use the
ARGV[0] ||?
I know that ARGV is an array, but I don't know what it is used for, or
why you would use it instead of making your own array. Also, why would
you assign the filename the user input *or* ARGV[0]?
The thing with the each_with_index is that the second record will have
a sequence of 2, and it should have a sequence of 1. So sequence only
goes up to the total carton size. It is a ?? of ?? cartons i.e. 1 of
12 - 12 of 12.
This stuff gives me a good head start though, thanks for the
information.
~Jeremy
On Nov 15, 10:15 am, Sebastian Hungerecker <sep...@xxxxxxxxxxxxxx>
wrote:
JeremyWoert...@xxxxxxxxx wrote:
I suck at recursion, and I need some help understanding where I'm
going wrong here.
You're not using recursion at all in your code. Recursion is if a method
invokes itself.
--
NP: Moonsorrow - Kivenkantaja
Jabber: sep...@xxxxxxxxxx
ICQ: 205544826
.
- Follow-Ups:
- Re: Recursion help.
- From: Sebastian Hungerecker
- Re: Recursion help.
- From: Alex Young
- Re: Recursion help.
- References:
- Recursion help.
- From: JeremyWoertink@xxxxxxxxx
- Re: Recursion help.
- From: Sebastian Hungerecker
- Recursion help.
- Prev by Date: Re: instance variables as class variable ?
- Next by Date: Re: ruby wish-list
- Previous by thread: Re: Recursion help.
- Next by thread: Re: Recursion help.
- Index(es):
Relevant Pages
|