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
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
-
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.