develooper Front page | perl.fwp | Postings from January 2002

Re: even.pl solutions

Thread Previous | Thread Next
From:
Jason Henry Parker
Date:
January 29, 2002 04:14
Subject:
Re: even.pl solutions
Message ID:
87wuy14anm.fsf@freezer.home
Matthew Byng-Maddick <fwp@lists.colondot.net> writes:

> On Mon, Jan 28, 2002 at 11:14:00PM -0500, Keith C. Ivey wrote:
> > But I was glad to see in the results several versions (by me 
> > and others) of the lovely
> >   -ln 1&($.|y|o|||y|e|||y|u|||y|a|||y|i|||y|y|||y|||c)||print
> Indeed, I thought that was very beautiful when I discovered it.

Hmm.  I tend to leave the regex-like operators delimited by slashes,
so I didn't get to appreciate the true beauty of this myself (I'm sure
I wrote exactly that pretty early on).

> It just didn't occur to me to use the $_ x=... trick, by which I'm
> still stunned.

I found it by going back through the analyses of the previous
tournament's winners.  After that, the score dropped from the mid-80s
to 77 in about a day.  The other key was using a /./g match on
"aeiouy".
-- 
||----|---|------------|--|-------|------|-----------|-#---|-|--|------||
| The way you tell your story                 http://linux.org.au/conf/ |
| With no tears for yourself                           jasonp@uq.net.au |
||--|--------|--------------|----|-------------|------|---------|-----|-|

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About