python coding contest

Duncan Booth duncan.booth at invalid.invalid
Tue Dec 27 10:24:44 CET 2005

Scott David Daniels wrote:

>> I definitively need a new algorythm. <g>
> And I am sadly stuck at 169.  Not even spitting distance from 149 (which
> sounds like a non-cheat version).

Throw it away and start again with a fresh (clean) solution. That's what I 
did when I'd reached the limit of nested maps and lambdas at 150 
characters. I'm now on 134 characters and the solution is very nearly 
legible. (Frustratingly, I'm away for the next few days, so I may not get a 
chance to submit my solution).

It would be a nice idea to come up with a scoring system which better 
reflects Python's ideals. For example, use the parser in Python to count up 
various syntactic elements, score 0 for comments, indents, dedents, 
newlines, docstrings, 1 for each name or operation used and higher scores 
for things like lambda or overly complex expressions.

More information about the Python-list mailing list