in reply to Is Perl less compact than Ruby? (Kind of competition)
that's another 5 chars.$n=0;
Also, put pop@n in a sub at the beginning:
then replace:sub p{pop@n}
throughout. another 20 chars saved.pop@n => p
sub w{push@n,$_[0]}sub p{pop@n}map{push@L,@C+0;push@C,split//,lc}<>;wh +ile($n<@C){$_=$C[$n++];if(/n/){$0=0;/-/ or$0=$_+$0*7while($_=index"ht +aoinse",$C[$n++])<7;w$0}if(/t/){$_=p@n;$_?$n=$L[$_-1]:last if p@n}/a/ +&&push@n,1+grep$n>$_,@L;if(/h/){$_=p@n;$n[$#n-abs];$_>0&&splice@n,@n- +2-$_,1}/o/&&print+chr(p@n);/s/&w-(p@n)+p@n;$0=p@n,$_=p@n,w(int$_/$0), +$_%$0if/e/;w($_=getc)?ord:-1if/i/}
cLive ;-)
Update - d'oh, yep, another 16 chars saved by changing p@n to p (updated above) - that means we can also save another 10 chars by whacking push@n,'whatever' into a sub.
What's that now? 379 chars?
--
seek(JOB,$$LA,0);
|
---|
Replies are listed 'Best First'. | |
---|---|
20 bytes from cLive ;-)
by locked_user mtve (Deacon) on Feb 18, 2002 at 21:25 UTC | |
by locked_user mtve (Deacon) on Feb 18, 2002 at 21:37 UTC | |
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 | |
by Anonymous Monk on Feb 18, 2002 at 22:17 UTC |