Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

by xtype (Deacon)
on Feb 13, 2002 at 06:31 UTC ( #145093=obfuscated: print w/replies, xml ) Need Help??

#!/usr/bin/perl use strict; use Getopt::Std; $_='75736 5207661727320 71777E246 F70745F7020246F 70745F637E3B0A6765746 F70742827706327 293B0A6D7924683B0A6966286465 66696E656420246F70745F63297 B0A206F 70656 E20434F44452C223C246F70745F63226F7220646 9652263616E6E6F74206F70656E20246F70745F6 35C6E223B0A207768696C65283C434F44453E29 7B24682E3D245F3B7D0A20636C6F736520434F 44453B0A7D656C73657B0A2024683D3C3C27484 558273B0A245F3D27375F263930313030313030 3131313130303130303130303131313130303131313 130363230343530333231303031333230343530333230303130 343230313131333630333030323030303332303030343030353030333 1313135303331313330363231353431333032313133303032313133303231313 330303231313131333639596D5054612628395339263E3938395A395539263E395F3 95A39 4C39263E3928395A395239263E3929395A394239263E395C5C5C3 95A394639263E3945395A394E39263E395C6E3929594A72696E483 +86D 614A255045303132333435364553554C5242464E4559376125375F5 +85873 4A6C6948454559273B79274A485A262537 38395854595045277 +0742C3D 7B2420227D253B792F273B6576616C3B 245F3D +2827212 3383F257371242225717A3F3E25393 4 +23716B3 4233D717330323A3423673F73275 + E28 276127783333295E2828282828 2730277836292E275A272E 27302 77834292E275A272E27302 77837292 E275A272E273027783429 2E28275A2 72E2730277835292E275A 272E2730277 83229293B73706C697428 272227293B245 F5B315D3D222 0222E 75636669727374 28737562737 47 228245F5B315D2C3 62C3329292E 2220222E245F5B315 D2E225C2222 3B24223D2722273 B245F3D7171 7E405F7E3B657 6616C3B0A4 845580A7D0A6D79 24633D225C245F3D27222E75632 8756E7061636B2822482A222C 246829293B0A24632E3D717 17E273B732F5C5C732A2F2F 673B 6576616C28706163 6B 22482A222C5C2 usage: [option] 45F293B7E3 options: B0A696628 -p <file> pattern file, assci +i art. 21646566 -c <file> code file, your per +l code. 696E6564 output: 20246F7 itself is an example of the o +utput. 0745F70 297B24 6F7074 5F703D 24303B 7D0A23 20 49206C 6 96B 65207 46F20636 F6D 6 D656 E74206 D792063 6F64652E2 + 02D7 8747 970650A6D7 9246F3 B0A6D79 2463743D3 0 +3B0A 707269 6E742223212F7 5 73722F 62696E2F7065726C 20 +2D7 75C6E757365207374726963 743B 5C6E2 23B0A707 2696E74222 320 +63 6F707972696768742032303032204A 65666 6726579204B65726E5C 6E22 +696 62821646566696E656420246F70745F6 329 3B0A6F70 656E2050415454455 +24E2 C223C246F70745F70226F72206469652263616E6E6F74206F70656E20246F70745F705 +C6E223B 0A7768696C65283C5041545445524E3E297B0A2063686F6D703B0A207768696C65282F +282E292 F67297B0A20206966282431206E6520222022297B0A202020246F3D737562737472282 +4632C24 63742C31293B0A2020202463742B2B3B0A20207D656C73696628243120657120222022 +297B0A2 02020246F3D2220223B0A20207D0A20207072696E74246F3B0A207D0A207072696E742 +25C6E22 3B0A7D0A246F3D7375627374722824632C246374293B0A7072696E74246F3B0A636C6F +7365205 041545445524E3B0A'; s/[^A-F0-9]//g; eval pack"H*",$_;

Replies are listed 'Best First'. - info
by xtype (Deacon) on Feb 13, 2002 at 06:53 UTC

    I got this idea from playing with gmax's camelfilter code.
    Actually, I decided to post the code with which I created my original idea. My original ascii art obfuscation is nifty in and of itself. However. this way everyone gets the two-for-one deal. (roll your own!) Also, I figured that no one would have their code view set that wide (106) so I wanted something narrower (this) to print it.
    So here you go, turn any code snippet into instant obfu/ascii-art!
    If a pattern file is not specified it attempts to read itself as the model.
    If you wish to use the shark art remove the usage and shebang (passing Getopt and strict on the command line).
    The very least you will want to do is pass it a file containing some perl (with -c).
    It worked on everything I ran it against however, I am sure that in some cases tweaking of the input code will be required.
    Besides itself and the XTYPE obfu (now posted bellow), one of my favorite tests was a DNA strand using theorbtwo's dnareader. Worked out of the box! A link to an ascii art generator can be found at crazyinsomniac's homenode.
    And yes, sharky printed itself.
    I was about to post the plain code but thought it would be nicer if it generated itself. I needed an excuse for naming it sharky. ;^)
    Enjoy.    -xtype

    Update: I did away with creating a "pattern" variable (ie. S7F12:.. as per, and instead read the pattern file and create the output all in the same loop. Making it a lot shorter and faster. Although it no longer has a default "pattern" it will attempt to read itself if opt_p is undefined. I posted the original Obfuscated ASCII-art code (that used to print by default) in reply, since that was the reason for me noding this.
    Perhaps this should be in Craft now that the obfuscation has been removed from it? -oh well.
The Obfuscation:
by xtype (Deacon) on Feb 13, 2002 at 18:13 UTC
    ./ -c -p xtype
    xtype pattern from ASCII Generator font:doh
    #!/usr/bin/perl -w use strict; $_=' 245F3D2 7375F26 3930313 0303130 3031313 1313030 3130303 1303031 313131303031313131303632303435303 33231303031 +3 332303435 303332303031 3034323 0313131 3336303330303230303 0333230 3030343 0303 +53030333131313 5303331313330363 2313534 3133303 2313133303032313133 3032313 1333030 3231 +313131333639596 D505461262839533926 3E3938395A3955 39263E395F395A394C3 9263E39 28395A3 9523 +9263E3929395A394239263E3 95C5C5C 395A39463926 3E39453 95A394E 39263E3 95C +6E39 29594A72696E48386D614A255045 3031323334 3536455 3554C52 42464E4 559 +3761 25375F5858734A6C6948454559 273B79274A 485A262 5373839585459 504 +5277 0742C3D7B2420227D253B792F 273B6576616C 3B245F3 D28272 123383F2573 712 +4222 5717A3F3E25393423 716B34233D7173 30323A3423673F7327 5E2827612 778 +3333295E282828282827302778 36292 E275A27 2E27302 77834292E275A272E2 7302778 372 +92E275A272E2730 277834292E28275A272 E273027 7835292 E275A272E2730277 8322929 3B7 +3706C697428272 227293B245F5B315D 3D22202 22E7563 6669727374287 3756273 747 +228245F5B315 D2C362C3329292 E222022 2E245F5 B315D2E 225 +C222 23B2422 3D27222 73B245F 3D7 +1717 E405F7E 3B65 +76616 copyright two-thousand-two Jeffrey Kern C3B0A';s {[^A- +F0-9]} ..g;eval(pack "H*" +,$_);
      FYI, that's FIGlet running under the hood of that website. And a plug, you can do that in perl with Text::FIGlet, a much improved version is imminently due.

      UPDATE: It has escaped, enjoy.

      perl -pe "s/\b;([st])/'\1/mg"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://145093]
Approved by root
[shmem]: Discipulus: while (readdir DIR) works fine
[Discipulus]: Eataly vs World(coffe) ;=)
[Discipulus]: shemem i wrote it directly.. but when i tested it i got a lot of 'undefined value..'
[Corion]: Oh, poor Trump can't get a break. Even the Vatican only sends the second in command to greet him...
[shmem]: Discipulus: readdir has the same semantics as readline (a.k.a <>). Have another coffee ☕ ;-)
[Discipulus]: ah! just with my old system perl (5.8.8) was needed
[Corion]: Has anybody toyed around with Mastodon? There is a Perl module for it, but I'm not sure that it's a yak worth chasing
[Corion]: On the upside, maybe running that for my family would be interesting, or at least for myself
[Corion]: I'm not fond of using a server hosted by other people, even if they claim to be GNU ;)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2017-05-26 07:31 GMT
Find Nodes?
    Voting Booth?