En op 14 juli 2002 sprak /-\:
> The Speedy-Gonzalez Hall-of-Fame
> --------------------------------
> ...
> 2. Terje K 0:00.33 (112.56)
In trying to understand why:
112.56 Terje K Sun Jul 7 04:23:55 2002 -nl $h{_}{$'}=/
/;$h{$'}{$`}=1if$`ne$'}{sub
z{$u{$_}++&&die,$y{$_}||=z($_)+print,$u{$_}--for
keys%{$h{+pop}}}z _
is so fast, I noticed it is not quite correct, failing on:
a _
_ c
An underscore, being in the range !-~, is a valid node character.
Mr referees, am I interpreting the rules correctly?
Do you still care anymore? ;)
However, Terje's 113-stroke solution:
113.56 Terje K Sat Jul 6 18:42:38 2002 -nl $h{$;}{$'}=/
/;$h{$'}{$`}=1if$`ne$'}{sub
z{$u{$_}++&&die,$y{$_}++||z($_)&print,$u{$_}--for keys%{$h{+pop}}}z$
seems OK because it uses $; (\034), which is outside the !-~ range.
And it can be easily improved to 110:
-nl $h{$;}{$'}=/ /;$h{$'}{$`}=1if$`ne$'}{sub
z{1/!$u{$_}++,$y{$_}||=z($_)+print,$u{$_}--for keys%{$h{+pop}}}z$
Curiously, using '_' instead of $; gained Terje a whopping 0 strokes.
;)
/-\
I have a tendency to cheat on these PG's :)
The reason for the _ is that it infact got me a .02 gain.
I found another 1 stroke advantage that was no cheat later but since it would not
advance me on the list i didnt bother.
here it is.
-nl $h{$a}{$'}=/ /;$h{$'}{$`}=1if$`ne$'}{sub
z{1/!$u{$_}++,$y{$_}||=z($_)+print,$u{$_}--for keys%{$h{+pop}}}z
by using an undef $a, i dont need to send a parameter with the first call to z.
I was by a little study of Eugene's solution i came up with this tho.
-nl $h{$a}{$'}=/ /;$h{$'}{$`}++if$`ne$'}{sub
z{map$y{$_}||=1/!$u{$_}+++z($_)+print,keys%{$h{+pop}}}z
thats 100 .. wish i could get under 100 tho.
Terje K
--
_______________________________________________
Download the free Opera browser at http://www.opera.com/
Free OperaMail at http://www.operamail.com/
Powered by Outblaze