Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Tested under both Linux and Windows.

When you run this with any argument, for example:

% perl blocks x

the program simply displays itself using all '#' characters (which makes it easier to read the letters depicted in the blocks in the ascii picture).

When run without arguments, the output gets REALLY interesting!

Warning -- this program is fairly memory intensive, so it's not recommended that you run it on a system with lots of other processes running concurrently.

Update:  Note, too, that the program creates/overwrites a file called 'x' in the current directory.  (Thanks shmem!)

Update 2:  Also note (especially for Linux users) that the Tk module must be installed.

Update 3:  A hint about deconstructing the program is this -- try running Deparse on the temporary file "x" which is created:  perl -MO=Deparse x

if(pop){undef$/;open$x,$0;$_=<$x>;s/\S/#/g;die$_} s'' useQTk; P($M=newQMa inWindow);$M->g eometry("0x0");subQ J{sprintf"#%02x%02x%02 x",randQ256,randQ256,r a ndQ256}subQA{$m->geome tr y(sprintf"%dx%d+%d+ %d" ,$ s,$s,$x-$s/2,$y -$s/ 2)}su bQP{$_[0]-> overr ideredir ect(1)} subQH{ ($G,$H,$I)= ($_ [0]->ge ometr y=~/( \d+)\+(. +)\+ (.+)/ );($H+$G /2, $I+ $G/2 )}subQ_{ @C= (J,J, J,J )}_;$A=p op; $M- >af ter(50, sub {m ap{ ($o,$p )=/ 4|5/? (7* $_-27 ,1) : (2+((ord) -54 )/7, 1+((ord )-54 )%7);$ J.= "#" x$o. $"x$ p}split //, q[5 77 EUE7 7ER76 KL576RTR77E R76KV 8 7678 :76 =67887 697:877;:76=678 87 697: 878@ :RR788 REV87:8:RR788REP87; 7:76 6= 788 769F 7 87687:766=78876967UEZ: 7677 G876K 77H FM :7677G876K88SKM<78GE96 K PYKS<77SR87KV86977< 777 7847897:86977<7777:699 7: YE S<SS:HEVSEM<SS: HEP; 9G<7777:699J;968<77 778 47896 ;;K77N7777R 87K7: ;K 86N7778E96K86]; ($s, $d)=($A% 2)?(37, -8):(4 ,3);w hile($q=sub str$J ,0, 80,"") {++ $r;$j=0 ;_QifQ$A >1;map{ $x=30+ 12* ++$j;$y=1 2*(11+$r +2* ($r>10 )); if(!/Q/ ){P ($m=$M->Top level);_ Qif $A>3;$m ->config ure (-hi ghl ightt=>1 ,-hig hlightb =>"black ",- bg =>$ C[($j<31 )+2*($ r<11) ]);push@ A,$ m; &A} }split/ /,$q;$ m ->u pdate}wh ile (13! =$s ){$s+= $d ;@ B= @A; while(@ B){ $_=spl ice @B,ra nd @ B,1,(); ($m,$s ,$x,$y)=( $_, $s,H ($_ ));&A;$ _->up date}} sle epQ 3;ma p{$b=sp lice @A, ran d@ A,1,();$b-> wit hdraw } @A;exit} ); Ma inLoo p ';s /\s//gx; s/Q/$"/gx; open$X,">x"; print $X $_; map{ system( "perl x $_ ")} 0..5


In reply to Alphabet Blocks Japh by liverpole

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (3)
    As of 2018-05-22 22:12 GMT
    Find Nodes?
      Voting Booth?