Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Pixel art

by Grimy (Monk)
on May 18, 2012 at 13:21 UTC ( #971298=obfuscated: print w/ replies, xml ) Need Help??

eval'op e PnY+0;opPen *XP PYH,">$0.bmp" ;XprPiYnt(KHY+pack "XsxPY8Kl2s4a*(YH24 )X*PXPYL",19K778,7Y4, 1X2,PXPL24,32,K1,4,uYn pXaPXcPLk("u",uKc"p_/ sX[PX^-Pj=L0d7l3K+i?,v _Xrko3[aruPe=LanzgK%7=u )X<=y;/RXR RL_"),sPort {X1}grepRN{ RLs/P.\n /X\t/;Rs N RP/\ HX/\t/R; N RX0u ntXil!sR/(N RX.) [JPX!-I RZO X-~] /JP$X1$R1QO X/}< 0J>PX)&&NQ XqqP: |J&&PX::; X'=~s/ |[JfhPX\uj-\uyPX:| qw`&JAPX]//gr#xP/ #MP[\J]PEFXGHIP/ #MP{}JP P__/ #MZPAC| #MPDB/ #MZP| #MP| #Mw| #Mw| #M/ #/ #
Generates this pixel art of Rainbow Dash (it will be named "$0.bmp"). Requires Perl v5.14 (see below for a more compatible version). Can't be run from the command line, must be stored in a file (without trailing newlines). Strict and warning compliant. Only tested under Strawberry Perl.

Comment on Pixel art
Download Code
Re: Pixel art
by FloydATC (Hermit) on May 19, 2012 at 19:41 UTC
    Out of curiosity I used the 'download' link and tested it using Strawberry Perl but got the following:
    Bareword found where operator expected at ob.pl line 21, near "qw`&JAP +X]//gr" (Might be a runaway multi-line // string starting on line 19) Can't modify constant item in substitution (s///) at ob.pl line 32, ne +ar "qw`&JA PX]//gr#xP/ #MP[\J]PEFXGHIP/ #MP{}JP P__/ #MZPAC| #MPDB/ #MZP| #MP| #Mw| #Mw| #M/ #/ # " syntax error at ob.pl line 32, near "qw`&JAPX]//gr#xP/ #MP[\J]PEFXGHIP/ #MP{}JP P__/ #MZPAC| #MPDB/ #MZP| #MP| #Mw| #Mw| #M/ #/ # " Execution of ob.pl aborted due to compilation errors.

    Did the closing quote mark was lost somewhere underway? I'm not ashamed to say I don't really understand what's going on here :-)

    -- Time flies when you don't know what you're doing
      Your version of perl seems to believe that the s/// ends right before the qw`, which is wrong. The qw` is supposed to be inside the s///, that's why there's no need for a closing backtick. I must admit I have no idea why it doesn't work for you. I tested both the download link and the copy-paste with Strawberry Perl 5.14.2. Here is a (hopefully) more compatible version, thanks to Anonymous :
      $_='ope n P+I0;priPnt (HP PIS"\Ubm",pac kH"xP8Il2sK4Ia*(\u hH24PI)K*",74,1I2,2 4H,PHPIL32,1K,4,unIpa cHk(PHPLu=>uc"Kp_/s[I^ -HjPH=PL0d7l3+iK?,v_r kHoPH3[ParLue=anKzg%7= uH)<=y;/_"P),LsortK{ope nH*S,">BHB BL$0.bmPp"} gHrep{s/BN\ BLS/P\t/ ;Hs/.\Bn N BP/\ tH/,unBt N BHil !sH/(.)B[^N BH\h \JPHUb- BqO H]/$ 1JP$H1/B}QO H<0> )JAPH;#UNQ HeaP| &J~~PH';s H[A-R| &~J]|PHq###%jAPHeg ;my$JAPH=eval.'P/ \MP@%J+P__H::$P/ |MPTUJP P___ |MAPZX| \MPWY| |MAP| \MP| |Mw| |Mw/ |M/ |/ '
      If you're curious enough, you might try it. You may also try replacing eval with print, this should print some human-readable code to STDOUT.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://971298]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-04-19 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls