Re: Permutations.
[email protected] ("Wladimir Palant")
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
> I found this on the perl-beginner list:
> Perl -e
> '*,=sub{print+local$*=$*.$_[$_],$/,&,(@_[1+$_..$#_])for$#..$#_};&,(1..5)'
>
> By Paul Johnson, which isn't to shabby, but not really up to specs.
>
> Anyone?
Of course :)
Perl -e "sub a{print+local$*=$*.shift,$/,a(@_)for$#..$#_};a(1..3)"
Wladimir