#!/usr/bin/perl -w
use#me
strict;use#emacs!
integer;my@cam=map{0+(eval"
0b$_")+1}map{s!(...)!'$1',!gxgxg;
eval"($_)"}map{sprintf"%.9b",hex}("0",
"0","0","0","0","db","db","a2","114","e2",
"112","92","10","80","0" ,"30",qq@180@,
"186",qq'1b6',"1a6", "003"+123,
"135","1ff",q~1ff~, "91"-10,
"12",qq^41^,q:93:, "e5","1b6" ,"1fe",
"0",q&49&,qq;92;, "9a","30","0", q%35%,
"1b6","1f8",q=0=, "1",qq#49#,"49", q!52!,
"92",q{e4},"12d", "176","1b6","1b6" ,"1be"
,"1c8","b",q[48], "35","199","12f", "140",
"1",qq(88),q-3e-, qq+f3+,qq*13c*, "140",
"1c7","161","12c", q/55/, q;;. "10c",
"124","124","125" ,q<7>, q"140",
"2","122","7","1ac" ,"000","000","000"
,"000","000","000" ,"000","000"
,"000","000","000" ,
+##
"000","000","000", qq|000|
+);
open$_,$0;undef$/; $_=<$_>;;s<[\
+n
\s]+><>gix;my$ec=(q ~ ~x54 .qq, \n,)x25;
my$in=0.0;my$out;my $klin=$^O=~m~win~ix?qq"cls":
qq$clear$;while(1.){ my$ecr=$ec;;my($coL,$col)=(
19,00);my$car;for my $mv(@cam){A:{if($col==0
&&$coL==q=19=){$car= $out,last A if defined
$out and$out ne qq . .;;$car=(++$|+$in<
length and substr$_, $in++,1 or q- -),#
last A;;;;}--$coL,-- $col;;;;$ec=~m;(?:
[^\n\r]*\n){$coL}(?: [^\n\r]{0,$col})(#
[^\n]?);mix;;++$col,++ $coL;;$car=defined(
$1)?$1:q[ ];}$coL-=($mv <6)?1:0;$col+=(!($mv&4)
||(vec($mv,0,2)==3))?1:0;$col-=(($mv&4)||(vec($mv,0,2)==
3))?1:0;$coL+=(($mv>4)||($mv==1))?1.:0.;$out=$car if(
$col==0);--$coL,--$col;$ecr=~s[((?:[^\n]*\n){$coL})
([^\n]{0,$col})([^\n]?)][$1.$2.(q? ?x(length($2)
-$col)).$car]mex;++$coL,++$col; }$ec=''.
$ecr;system$klin;print $ec;}
#!
Blop!
Note 1: 5.6 required. Thanks to
chazzz for testing it under Windows.
Note 2: that's supposed to be a flower, on the right :) (in the output).
Update: changed a character or two, trying to make it work for windows addicts (thank you
Ven'Tatsu for your remark).
In reply to GGGraffiti
by Blop
-
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.