Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Re: Re: Re: Re: Character Combinations

by chunlou (Curate)
on Aug 23, 2003 at 01:05 UTC ( #285971=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Re: Character Combinations
in thread Character Combinations

Silly me. Should have consulted with this: Permutations and combinations.
use Algorithm::FastPermute; sub combinations { return [] unless @_; my $first = shift; my @rest = combinations(@_); return @rest, map { [$first, @$_] } @rest; } for(combinations('a'..'c')){ my @c = @{$_}; permute {print @c , "\n"} @c; } __END__ c b bc cb a ac ca ab ba abc acb cab bac bca cba

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://285971]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2016-10-27 19:17 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (369 votes). Check out past polls.