I like this one much better than the 97, though 1 stroke hardly makes much difference when I'm 9 behind the next guy and 56 behind the leader.
#!perl -l
s~~@ARGV~;s~(.*)(.)(.*) \2((??{"[|$1]*"}))(.*)| ~$\=$2.$\;$2&&"$3 $5
$1 $4"~ewhile/./;print@}
|
#!perl -l s~~@ARGV ~;s~(.?)(.*) (.*)\1(.*) ~$1&&($\=$1.$\,substr$2,length$3)." $4 $2 $3 "~ewhile$_;print |
I like this one better than my last, but it's one stroke longer. Too bad I can't get rid of the messy way of dealing with empty subtrees.
#!perl -l
s~~@ARGV
~;s~((.*)(.)(.*) \3((??{"[|$2]*"}))| )(.*)
~$\=$3.$\;$3&&"$4 $6
$2 $5
"~ewhile$_;print
|
Progress at last! This shows more promise.
#!perl -l
while(@ARGV){pop=~/./;($_,$})=split$&,pop||next;$\=$&.$\;push@ARGV,$_,$',$},substr$',y|||c}print
|
Well, I've passed Yanick for now, but several other people have passed me, so my position is dropping.
#!perl -l
sub'z{pop=~/./;$_=pop;my$z=$';split$&;$_&&{$\=$&.$\}&z(pop,substr$z,length$_[0])|z(shift,$z)}print+z@ARGV
|
Still 0.02 behind Yanick!
#!perl -l
sub'z{pop=~/./;$_=pop;my$z=$';split$&;$_&&($\=$&.$\)&z($_[1],substr$z,length$_[0])|z(shift,$z)}print+z@ARGV
|
Still haven't had The Insight, so I'll keep nibbling at this one.
#!perl -l
sub'z{pop=~/./&&($_=pop)&&do{$\=$&.$\;@_=($',split$&);z(pop,substr$_[0],length$_[1]);z(pop,pop)}}print+z@ARGV
|
#!perl -l
sub'z{pop=~/./&&($_=pop)&&do{my($w,$x,$y,$z)=($',$&,split$&);z($y,$w),z($z,substr$w,length$y),$x}}print+z@ARGV
|
Finally passed somebody, but still on a dead-end path
#!perl -l
sub'z{pop=~/./&&do{my($w,$x,$y,$z)=($',$&,split$&,pop);z($y,_ x length$y&$w),z($z,substr$w,length$y),$x}}print+z@ARGV
|
#!perl -l
sub'z{$_[0]=~/./&&do{my($m,$o,$p,$q)=($',$&,split$&,pop);z(_ x length$p&$m,$p),z(substr($m,length$p),$q),$o}}print+z@ARGV
|
#!perl -l
sub'z{my($m)=@_;$m=~s/.//&&do{my($o,$p,$q)=($&,split$&,pop);z(_ x length$p&$m,$p).z(substr($m,length$p),$q).$o}}print+z@ARGV
|
Somehow I don't think this is ever going to get down to a reasonable length, but at least it works (and this time I'm even submitting it in the right place).
#!perl -l
sub'_{my($m,$n)=@_;$m=~s/.//||return;my$o=$&;my($p,$q)=split$o,$n;_(substr($m,0,length$p),$p)._(substr($m,length$p),$q).$o}print+_@ARGV
|