Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

The Best Ever

by BooK (Curate)
on Nov 13, 2000 at 18:33 UTC ( #41310=obfuscated: 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?

Replies are listed 'Best First'.
Re: The Best Ever
by ambrus (Abbot) on Oct 09, 2012 at 20:52 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://41310]
Approved by root
[marto]: good morning all
[Corion]: Hi marto!
[Corion]: I hope you had a good weekend!
[Discipulus]: good morning again monks!
[choroba]: Good morning!
[Corion]: I have a rough plan to release an ImageNet classifier in Perl (well, using pretrained data, but still a nice toy)
Discipulus is going mad with the new win10 client.. tried mv Cortana /dev/null but no succes
[Corion]: Ouch - another pretrained set is available, using images from IMDB and Wikipedia. So I expect interesting results for non-PR images where people are pictured that are not made up

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-09-25 08:27 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (277 votes). Check out past polls.