Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

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

Well, this one was too long (951 bytes) for category 4 The Old Standby, but was rated The Best Ever by the judges... (I did submit it for Inner Beauty, but hey)

The Perl part need an ANSI term for it use some escape codes for highlighting, and the PostScript part need ghostscript or you friendly neighborhood PS printer.

Please note that whitespace actually holds information. And yes, it is actually PostScript: it ends with showpage...

/;{}def/#{def}def/$_={/Times-Bold exch selectfont}#/_{rmoveto}#/"{dup} +#/*/!/$ ;/q{exch}#/x ; {/J q #}#/.{/T q #}#{stringwidth}#{}#{}# 14 string dup +dup dup 260 40 moveto 90 rotate ; %/}};$0='"\e[7m \e[0m"';@ARGV=split//,revers +e q(ThePerl). q(Journal) x 220 ; q ; 0 T putinterval exch 7 J putinterva +l ; ; $_= q /m$ pop T($*!$"=!$ " )pop " * true% ? $ " $!" " !! !! % !" +!" ! ! charpath {!"""}pop $ pop{""!}pop ! neg{!#}pop 220 ! neg _{!!}pop J f +alse %T charpath clip " pop 0 " moveto 6{!!}pop $_= 105{!!}pop {$ ! $ " ! #! + ##} pop{dup dup $ ! " pop pop q{"}pop 22{dup show}repeat {"}pop q 22 mul{$ + "} pop neg{!#! $ "}pop ! 8 .65 mul{$ # # $}pop ! neg{"}pop _ pop{"}pop } rep +eat pop " { $ " ! ! ! $ " ! !" "#" #"!"""""! #" " # "m/;@ARGV=(@ARGV[-14..-1 +])x50;q} 0 "%};s/m[ou]|[-\dA-ln-z.\n_{}]|\$_=//gx;s/(.)(?{$*=''})/('$*.='.(++$ +# %2?'':"$0;").'pop;')x(ord($1)-31).'$*'/gee;s/((.(\e\[.m)*|.){77})/$1\n +/g;print ; sub showpage {}

Excerpt from the SOLUTION file:

This program has a lot to tell. Though Perl and PostScript are very different in appearance (one if infixed, the other postfixed, one works with lists, the other with dictionaries...), in this case they performed quite hand in hand. I must add that PostScript is very well suited for obfuscation even for novices, thanks to the def operator.

If you look closer at the output of these two programs, you will notice that the highlighted part, the one that is missing in the output of the Perl program, is exactly (your screen/eyes/printer resolution may vary) the one that is printed by the PostScript file. Isn't this some complementarity?


In reply to The Best Ever by BooK

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 meditating upon the Monastery: (7)
As of 2024-03-29 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found