|Pathologically Eclectic Rubbish Lister|
Minimally changing combinationsby Yary (Pilgrim)
|on Jun 28, 2017 at 07:08 UTC||Need Help??|
Yary has asked for the wisdom of the Perl Monks concerning the following question:
There are a few modules on CPAN for generating combinations. For example given the lists
[ 'a','b','c' ] , [ 1, 2 ]
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.