CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Fun With Perl: Perl Golf:
Rearrangement [GOLF]

 



unknownSym
stranger

Feb 16, 2002, 10:30 AM

Post #1 of 6 (33536 views)
Rearrangement [GOLF] Can't Post

Who can come up with the shortest solution to change

Code
.comeads-thramergossaph@to:jmail

into

Code
mailto:japh@gossamer-threads.com

There best score is 39. That solution is at http://gossamer-threads.com/jobs/index.htm.


Paul
Enthusiast

Feb 16, 2002, 10:40 AM

Post #2 of 6 (33535 views)
Re: [unknownSym] Rearrangement [GOLF] [In reply to] Can't Post

I take it you don't know Jason (assuming it was him that wrote it) :)

No-one beats his code.

But how about:


Code
s/(.{4})(.{4})/$2$1/g+s/(.{8})(.{8})(.{8})(.{8})/$4$3$2$1/;



(This post was edited by RedRum on Feb 16, 2002, 10:48 AM)


mhx
Enthusiast / Moderator

Feb 16, 2002, 4:46 PM

Post #3 of 6 (33521 views)
Re: [RedRum] Rearrangement [GOLF] [In reply to] Can't Post


Code
$_=join'',reverse/(.{4})/g

-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo



yapp
User

Feb 17, 2002, 1:58 AM

Post #4 of 6 (33516 views)
Re: [mhx] Rearrangement [GOLF] [In reply to] Can't Post

Whuaaah! Cool very cool. That really beats the best score! PirateSmile nice.

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


Paul
Enthusiast

Feb 17, 2002, 2:56 AM

Post #5 of 6 (33511 views)
Re: [mhx] Rearrangement [GOLF] [In reply to] Can't Post

Mmmm you got lucky :)


unknownSym
stranger

Feb 18, 2002, 5:45 AM

Post #6 of 6 (33499 views)
Re: [mhx] Rearrangement [GOLF] [In reply to] Can't Post

Very nice. Good job.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives