On Wed, Aug 01, 2001 at 02:45:33PM +1000, [EMAIL PROTECTED] wrote:
> Abigail wrote:
> > Of course, all entries using -F// are fishy:
> >
> > Here's one without any regexes:
> >
> > perl -nle'$x=$:=$_;map$$x{chop$:}=1,0..9;keys%$x>9&10==y&&&c&&print'
> words
> >
> > Abigail
>
> I agree that g/./ and -F// are fishy; that was an oversight by me.
> Thanks for the tip using chop. I have improved the golf score
> a little, though I feel sure further improvement is possible:
>
> perl -nle'$x=$:=$_;map$$x{chop$:}=1,0..9;keys%$x>9&10==y&&&c&&print' words
> perl -ne'$y=$_;my%y;$y{chop$y}=1while$y;121- y&&&c*keys%y||print' words
The one thing I don't like about this one is that it won't generalize to
words of say, length 9 or 11. It only happens to work for numbers who are
one less than a prime number.
Abigail