Yary has asked for the wisdom of the Perl Monks concerning the following question:
[ 'a','b','c' ] , [ 1, 2 ]
they produce
a 1 a 2 b 1 # two changes this iteration b 2 c 1 # two changes this iteration c 2
There's another ordering, where only one position at a time changes. And there's a name for that ordering which I've forgotten, so I haven't been able to search CPAN for it. It would produce the tuples in an order like so:
a 1 a 2 b 2 b 1 c 1 c 2
Can anyone refresh my memory as to what that ordering is called, and as a bonus, find me a module on CPAN that already produces combinations that way?
... I have tried the the obvious keywords "permute" and "combination" on metacpan but suspect I'm missing the right word... yes I could implement it from scratch, or take the output of one of the CPAN modules and reverse some records to get the desired ordering. But why re-invent a wheel, if it's already been invented.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Minimally changing combinations
by Eily (Monsignor) on Jun 28, 2017 at 09:06 UTC | |
Re: Minimally changing combinations (updated!)
by haukex (Archbishop) on Jun 28, 2017 at 07:40 UTC | |
by Laurent_R (Canon) on Jun 28, 2017 at 17:03 UTC | |
Re: Minimally changing combinations
by tybalt89 (Monsignor) on Jun 28, 2017 at 13:54 UTC | |
by Anonymous Monk on Jun 28, 2017 at 14:20 UTC | |
Re: Minimally changing combinations
by Yary (Pilgrim) on Jun 28, 2017 at 16:15 UTC | |
by Yary (Pilgrim) on Jun 29, 2017 at 17:35 UTC | |
Re: Minimally changing combinations
by thanos1983 (Parson) on Jun 28, 2017 at 08:14 UTC |