Re: Permutations
- Posted by Patrick Barnes <mrtrick at gmail.com> Jun 30, 2004
- 614 views
> 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. One thing is, that the function needs to return indexes, not the values themselves, so that if I had this:
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
how would I alter the code snippet you gave me? -- MrTrick