Front page | perl.golf |
Postings from August 2002
Re: putting practice
Thread Previous
|
Thread Next
From:
Greg Allen
Date:
August 30, 2002 06:17
Subject:
Re: putting practice
Message ID:
20020830131719.75243.qmail@web12903.mail.yahoo.com
Wow, can't fault that. 3 tips (for me) arise:
1. never post a challenge before coming up with your own working solution - my
own non-working solution is ~130 chars - bloody aliens!
2. \pL - quite hard to find that in the documentation. Still can find complete
info on possible unicode properties - cool though.
3. don't use Vroman's DIY Perl Quick reference - it's for 5.004 and doesn't
even have a dagger for reverse. i.e. by default acts on $_.
think I try a decoder instead...
much learnt!
cheers,
Greg
--- Mtv Europe <mtve@frox25.i989.net> wrote:
> Hello Greg!
>
> gregallen_golfer@yahoo.com (Greg Allen) wrote:
> > # (1) Only letters will be encrypted.
> > # (2) Words with less than 3 letters will be reversed.
> > # (3) Words with more than 3 letters will be scrambled this way:
> > # * All letters on even locations move to the left-hand side.
> > # * All letters on odd locations move to the right-hand side.
>
> your sample output (those -> toe'hs) clearly shows opposite direction,
> i.e. odds (counting from one) to the left and evens to the right.
>
> > # * A "`" gets between the both sides if the word has more
> > # than 4 characters.
>
> and naive approach is 68, i believe:
>
> -p s#\pL+#$_=$&;/..../?join'',/(.).?/g,'`'x/.{5}/,/.(.)/g:reverse#eg
>
> ---
> Mtv Europe
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Thread Previous
|
Thread Next