Coding Challenge #4: Make an obfuscated 4-ch logo (30)

2 Name: #!/usr/bin/anonymous : 2006-04-21 21:41 ID:bBAXtCdY

I'll repost my entry here from the other thread:

@r=d('<,=@;,>B;,?<<;,<<<;,<<;,C=@:,C=A:,<<<<;<,<<<<:::::,<<<<<::=:,<B'.
'<<::::,<@<<:::<:,<,<,<');@c=d(';,<,=,>,<;,<;,I,I,I,;,,;,<;<,=;=,=;=,'.
';;,;;,;;,<<,<<,;;,,E,E,@,;,;,@,@,?,,:,,>,:,:,=,,<,:::,:::,;:,,:,@,:');
@f=map "." x@c,@r;for(a,b){for(0..$#r){foreach$c(0..$#c){$n=x ((join"",
map{substr$f [$_],$c,1}(0..$#r)),@{$c [$c]});(substr$f[$_],$c,1)=substr
$n,$_,1for(0..$#r);}$f [$_]=x($f[$_],@{$r[$_]});}}printf"$_\n"for@f;sub
x{$f=shift;my$l=length$f;return" "x$l if!@_;return c (grep m/^$f/,map{(
" "x$_).(X x$_[0]).(" "x($l-$_[0]-$_))}(0..$l-$_[0]))if@_==1;my$r+=($_+
1)for@_;$n=shift;return c(grep length$_==$l,map$$_[0].x($$_[2],@_),grep
$$_[0]=~/^$$_[1]/,map[(" " x$_).(X x$n)." ",$f=~/(.{$_}.{$n}.)(.*)/],(0
..$l-$r-1))}sub c{$r=shift;$r=~s/(.)/(substr$_, pos$r, 1)eq$1?$1:'.'/ge
for@_;$r}sub d{map[map ord($_)-57,/./g],split',',$_[0]}

I'll even post a first hint for those who want to try and crack it: Move the print statement two loops in to see the algorithm work:

@r=d('<,=@;,>B;,?<<;,<<<;,<<;,C=@:,C=A:,<<<<;<,<<<<:::::,<<<<<::=:,<B'.
'<<::::,<@<<:::<:,<,<,<');@c=d(';,<,=,>,<;,<;,I,I,I,;,,;,<;<,=;=,=;=,'.
';;,;;,;;,<<,<<,;;,,E,E,@,;,;,@,@,?,,:,,>,:,:,=,,<,:::,:::,;:,,:,@,:');
@f=map "." x@c,@r;for(a,b){for(0..$#r){foreach$c(0..$#c){$n=x ((join"",
map{substr$f [$_],$c,1}(0..$#r)),@{$c [$c]});(substr$f[$_],$c,1)=substr
$n,$_,1for(0..$#r);}$f [$_]=x($f[$_],@{$r[$_]});printf"$_\n"for@f;}}sub
x{$f=shift;my$l=length$f;return" "x$l if!@_;return c (grep m/^$f/,map{(
" "x$_).(X x$_[0]).(" "x($l-$_[0]-$_))}(0..$l-$_[0]))if@_==1;my$r+=($_+
1)for@_;$n=shift;return c(grep length$_==$l,map$$_[0].x($$_[2],@_),grep
$$_[0]=~/^$$_[1]/,map[(" " x$_).(X x$n)." ",$f=~/(.{$_}.{$n}.)(.*)/],(0
..$l-$r-1))}sub c{$r=shift;$r=~s/(.)/(substr$_, pos$r, 1)eq$1?$1:'.'/ge
for@_;$r}sub d{map[map ord($_)-57,/./g],split',',$_[0]}
This thread has been closed. You cannot post in this thread any longer.