Not sure how elegant this is, but it's easy if you compute the elements of your sets of numbers from last to first:
for my $i (2..3) { local $/=","; for my $line (0..4**$i - 1) { # you were missing -1 print "line $line - "; my $num=$line; my @tuple; for my $j (0..$i-1) { unshift @tuple, $num%4; $num/=4; } print "@tuple\n"; } }
In reply to Re: Incremental indexing exponential
by RMGir
in thread Incremental indexing exponential
by FFRANK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |