develooper Front page | | Postings from August 2002

Re: putting practice

Thread Previous | Thread Next
Mtv Europe
August 30, 2002 11:59
Re: putting practice
Message ID:
Hello Greg! (Greg Allen) wrote:
> Hurrah: a decoder.. much borrowed, too much added (scores 105).
> #!perl -p
> s#\pL+(`\pL*)?#$_=$&;$1||s/(..)(..)/$1`$2/;/`/?
> ($l=()=/../g)&&join'',/([^`])(?=.{$l}(.)?)/g:reverse#eg

this is more challenging task (albeit not so well-defined since
transformation is not reversable), and here is another solution (92):

-p s#\pL+`?\pL*#join'',@_[(split//,$&)>4?map{$_-

>> > #    (2)  Words with less than 3 letters will be reversed.

that must be readed as "less or equal" for clarity

Mtv Europe

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About