Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: (Golf) Character windows

by dfog (Scribe)
on Aug 28, 2001 at 03:29 UTC ( [id://108312]=note: print w/replies, xml ) Need Help??


in reply to (Golf) Character windows

Here is my solution of 44 chars.
#23456789_123456789_123456789_123456789_1234 map{$y=$_;map{$s[$_].=$y}$c..$s+$c++}/(.)/g;
It still has the problem of repeating the entire phrase if the window ($s) is larger than the length of the string. In order to correct that, I came up with a 65 character solution of
#23456789_123456789_123456789_123456789_123456789_123456789_12345 @t=/(.)/g;$s=@t<$s?@t:$s;map{$y=$_;map{$f[$_].=$y}$c..$s+$c++}@t;
Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://108312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-26 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found