Re: Permutations.

2002-12-10 Thread Eugene van der Pijll
En op 10 december 2002 sprak Tor Hildrum: > I'm currently at 200+ using a couple of nested for-loops and to much time, > which is basically why I was curios what you guys could come up with. > > I found this on the perl-beginner list: > Perl -e > '*,=sub{print+local$*=$*.$_[$_],$/,&,(@_[1+$_..$#_

Re: Permutations.

2002-12-10 Thread Eugene van der Pijll
En op 10 december 2002 sprak Eugene van der Pijll: > > perl -Xlne'sub a{print+local$*=pop.$*,a(@_)for(1)x@_};a/./g' Errr, that semicolon wasn't there when I posted it. Honestly. For some reason, none of these standard tricks work: (-ugene -- If you watch a game, it's fun. If you play at it, i

Re: Permutations.

2002-12-10 Thread Ton Hospel
In article <[EMAIL PROTECTED]>, Eugene van der Pijll <[EMAIL PROTECTED]> writes: > perl -lne'sub a{print+local$*=$*.shift,a(@_)for(1)x@_};a/./g' > > is the golf version. This one takes input from STDIN, as requested. > Same output, different order: > > perl -Xlne'sub a{print+local$*=pop.$