When I grow up, I'll be a Perl Programmer! (78)

22 Name: #!/usr/bin/anonymous : 2006-04-20 20:14 ID:MdOKSYEn

>>20 was really just a bit of syntactic obfuscation of a trivial algorithm, and therefore not much fun. Here is something more interesting:

@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]}

Try to figure out what exactly it is that the code does!

This thread has been closed. You cannot post in this thread any longer.