in reply to Re: Is Perl less compact than Ruby? (Kind of competition)
in thread Is Perl less compact than Ruby? (Kind of competition)
The change was to functionally remove the 0 at the beginning of @L. Adjusting the subscripts used to access @L seems to result in an acceptable performance.map{push@L,push@C,lc=~/./g}<>;sub p{$_=pop@n}sub w{push@n,@_}while($n< +@C){$_=$C[$n++];if(/h/){p;w$n[-1-abs];$_>0&&splice@n,-2-$_,1}if(/n/){ +w 0;$b<0||w$b+7*p while($b=index"htaoinse",$C[$n++])<7}$0=p,p,w int$_ +/$0,$_%$0if/e/;$a=p,p&&($a?$n=$L[$a-2]:last)if/t/;/a/?w 2+grep$n>$_,@ +L:/o/?print chr p:/s/?w-(p)+p:/i/&&w+($_=getc)?ord:-1}
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 29 characters to beat Ruby ...
by Matts (Deacon) on Feb 20, 2002 at 09:55 UTC | |
by dragonchild (Archbishop) on Feb 20, 2002 at 13:19 UTC | |
by locked_user mtve (Deacon) on Feb 20, 2002 at 10:46 UTC | |
|
increasing on 2 bytes
by locked_user mtve (Deacon) on Feb 20, 2002 at 10:02 UTC |