Mandelbrot set inspired me to write my first obfu. I used the Hilbert Curve (as featured in XKCD). It takes an optional numeric argument on the command line (should be a positive integer less than ten, with a default of 5). There's no error checking on the argument, but the rest of the code is warningless under strict+warnings. I might write more about it when I need to procrastinate further. :-) Hint:
#!/usr/bin/perl
use strict;
use warnings;
;$ "=q%ef%;$_ =q~my($i,$ x,$y,$p)=( 0,0,0,pop| |5);my$r=2
<< $p ;m y@ i= ma p[ (1 )x $r ,2
],1..$ r;subi {$i[$x ][$y]- -}i;su bp{((1 <$_[0] ?$y:$x
)- =1 -( $_ [0
]&1)*2 ,i)for -1,1}s ubf{my ($ p,$f)= @_ ;$p--; my@m=(
$f ,3 -$ f, 1- $f ); my @o =( 3- $f ,$
f, $f,$f-2)if $p>0;($_&= 3) for@o, @m;@o& &f ($p,pop@o)
,@ m& &p
(pop@m )while(@o||@m) }f$p,( $p&1)* 2;subb {y ,y4102,b#\
n, ;p ri nt }m ap {b fo r@ $_ }@
i~;y~ \n~~d; ;s&b&b &g;$;= 1; eval;# %$ _+28;$ x-=$y;
my ($ pi )= '3 .1 41
59 26535' ;$ ,= 2*2**$ [; ;my@b= map[5x $pi],1 ..$[;s
{} {q %S {$ b[ $x ][ $y ]= 0} S; su bp
{($_[0 ]>1?$y :$x+=- 1+$_[0 ]^2*2, S)for(0,1) }suba{($l,
$d
)=@_;$ l--;@m =map$_ *4,5-$ d,3-$d ,$d;@h=map $_*4,$d+2,
$d ,$ d, 3- $d if $l >0 ;{ a( $l ,s hi
ft @h)if@ h; @m &&p(sh if t@m);( @m+@h) &&redo }}a$l,
$l ^2 *2 ;p ri nt @$
_,$/fo r@b($x ,$y,$c )=qw/0 0* /;$l=s hi ft||4; $r=$s*
2* *$ l; @b =m ap [( '' )x $r ],
1..$r; for(0,1){eval[ qw/$x- -$x++$ y--$y+ +/ ]->[i$_[0]
]; $b [$
x] [$y]=$c;}@ m=split//, [q w/rdll urdruu ld /]->[i$d];
@h =s pl it // ,[ qw /u ll dd rr ul uu
rrddl/ ]->[i$ d]if$l >0;@m= sp lit//, {q w/lrdl rlurud
ru du ld /} ->
{$d};@ m=spli t//,su bstr'r dllurd ruuld' ,3*i$d ,3;@h=
sp li t/ ,{ qw /l ul ld rd rr uu
lu urdrddl/}- >{$d}if$l< 7;@m=split //,substr' ulldd'%}e;
|
had to waste some time today, this is how i did it ;)
use warnings; use strict; use Tk;eval '$.=q $25,25
,25,30,35,30, 35,10|40,20 ,40,30,50,30 ,50, 20|65
,20, 55, 20, 55, 25, 65,25 ,65,30
,55, 30| 70, 10, 70, 30,75 ,30|67
,15, 73,15|95,30, 97,30|100,30, 100,20,110,20,
110, 30|130,10,130 ,30,135,30| 127,15,133,15|
140, 10, 140 ,30| 140, 20,150
,20, 150 ,30 |155 ,25, 165,25
,165 ,20, 155 ,20, 155, 30, 165,
30|170,30,170 ,20 ,180 ,20| 25,60 ,25,40
,35,40,35,50, 25, 50|50 ,60, 40,60 ,40,50
,50,50,50,55,40,55|55,60,55,50,65,50|68,40,68,60,71,60|81,60,81,
40|81,50,90,50,90,60|105,60,107,60|120,60,110,60,110,50
,120,50|125,60,125,40|135,60,125,52,135,46|150
,60,140,60,140,50,150,50,150,55,140,55
|155,60,155,50,165,50|85,20,
95,20,95,30,85,30,
85,20|115,
20,125,20,125,30,115,30,115,20|95,50,95,60,105
,60,105,50,95,50$;$,=join("",map(chr,
(99,114,101,97,116,101,76,
105,110,101)));$;=
MainWindow
->
new->Canvas(-width=>200,-height=>80)
->pack;for(split(/\|/,$.))
{$;->$,(split(
/,/,$_))}
MainLoop;
;;;
'
obviously requires Tk...
|