Re: Permutations
- Posted by "Unkmar" <L3Euphoria at bellsouth.net> Jun 30, 2004
- 642 views
----- Original Message ----- From: "Patrick Barnes" Sent: Wednesday, June 30, 2004 1:48 AM Subject: Re: Permutations > > > That function is a permutation function. > > It will generate any requested permutation based on index and > > permutation set. > > Ah, I see. It would take a while to generate if the set was 1 million > objects in length, though. It *would* be more secure than a fixed > offset from the last point to the next. It doesn't support more than 17 in length atom size limitation. > One thing is, that the function needs to return indexes, not the > values themselves, so that if I had this: > }}} <eucode> > x = perm(original_sequence, number) > new = {} > for a = 1 to length(x) do > new &= original_sequence[ x[a] ] > end for > --at this point, new contains the permutation > </eucode> {{{ > how would I alter the code snippet you gave me? > > -- > MrTrick There are a couple ways of doing this. One method is a wrapper around what I have already created. Another requires a reworking of my code. I'm still not sure what 'number' is suppose to be. unless it is an permutation index value. A value that states *which* permutation to return indexing values for? unkmar