in reply to 20 bytes from cLive ;-)
in thread Is Perl less compact than Ruby? (Kind of competition)
and another similar optimization on push, now EQUAL TO RUBY - 357 bytes!!!
sub p{pop@n}sub v{push@n,@_}map{push@L,@C+0;push@C,lc=~/./g}<>;while($ +n<@C){$_= $C[$n++];if(/n/){$0=0;/-/ or$0=$_+$0*7while($_=index"htaoinse",$C[$n++ +])<7;v$0} if(/t/){$_=p;$_?$n=$L[$_-1]:last if p}/a/&&v 1+grep$n>$_,@L;if(/h/){$_ +=p;v$n[ $#n-abs];$_>0&&splice@n,@n-2-$_,1}/o/&&print+chr(p);/s/&&v-(p)+p;$0=p, +$_=p,v int$_/$0,$_%$0if/e/;v(($_=getc)?ord:-1)if/i/}
Thank you!!! What's next?
| Replies are listed 'Best First'. | |
|---|---|
|
Re: err, i miscounted
by locked_user mtve (Deacon) on Feb 18, 2002 at 21:47 UTC | |
by dragonchild (Archbishop) on Feb 18, 2002 at 21:56 UTC | |
by locked_user mtve (Deacon) on Feb 19, 2002 at 07:33 UTC | |
|
Re: err, i miscounted
by Anonymous Monk on Feb 18, 2002 at 22:17 UTC |