I see no reason to resort to recursion:
- tye (but my friends call me "Tye")#!/usr/bin/perl -w use strict; my @letter= map { [ split // ] } qw( CAT DOG BIRD ); my @idx= (0) x @letter; while( 1 ) { print join( "", map { $letter[$_][$idx[$_]] } 0..$#letter ), "\n"; my $i= 0; while( $i < @letter && $#{$letter[$i]} < ++$idx[$i] ) { $idx[$i++]= 0; } last if @letter <= $i; }
In reply to (tye)Re: Sort of a permutation
by tye
in thread Sort of a permutation
by KM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |