Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Thanks. I originally golfed it down while trying to use as few unique characters as possible. Fun 'vim' command du jour (use after you've selected some lines in Visual Line mode):

:'<,'>!perl -lpwe '$h{$_}++for split//; END { print "\# $_ ", sprintf "\%02d", $h{$_} for grep /\S/, sort { $h{$a}<=>$h{$b} or $a cmp $b } keys \%h; }' | perl -pwe 'next unless/^\#/;$a||=$.-1;chomp;$_.=($.-$a)\%10?" ":"\n"'

I may still write a variation that uses a different obfuscation method. (Anyone know of a golf competition that uses that metric [number of distinct chars.] as part of the score?) I think 30 was the lowest I managed while keeping it under 5 lines. (excluding the 'reëxpanding and evaluating' code)

$&(),-13;<=@[]_bfimnoprstuxy{}

The alphabetics came from 'sub', 'print', 'pop', 'if', 'my', and the 'x' operator.


In reply to Re: Hilbert Curve by benizi
in thread Hilbert Curve by benizi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found