Hats off to Ton and Lars!

>> Ton Hospel <[EMAIL PROTECTED]> writes:

 > -l $_=pop;s;.;print,s,,$&*1.11%10if/\G../,eg;eg

 Wow.  My last fumblings where something along the lines of:

 -l $_=pop;0while+print,s+.+$&*111%100if/../+eg,chop

 which I couldn't get to work.

 Perhaps as post-mortem regarding that discussion about the tiebreaker,
 I was wondering how you guys got rid of the while.  I guessed there
 wasn't a while involved because I thought "there's got to be a pop, a
 print, certainly an s with e and g".  If figured the best solution
 didn't had a while in it since in mine that uses 7 strokes with 6 \w's.
 The above solution also uses 7 strokes for the "same" purpose
 (side-effects aside, which is the killer), but the tie-breaker is
 lower.

 The 1.11%10 bit made me giggle for some reason.

 Regarding my "one step" solution, the secret can be computed as:

    Op(i=1..digits, C(i, digits)*digit[i])

 where Op(a,b) := (0, 1..9, 1..9, ...)[a+b] and C(i, j) := j!/i!/(j-i)!
 (or something like that, I can't think straight right now).  This lead
 to a horribly long solution that doesn't even pass the test program :-)

 Thanks guys, my first tournament ever was lots of fun!

-- 
Marcelo

Reply via email to