python coding contest
Bengt Richter
bokr at oz.net
Wed Dec 28 03:09:51 EST 2005
On 27 Dec 2005 09:24:44 GMT, Duncan Booth <duncan.booth at invalid.invalid> wrote:
>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.
[23:28] C:\pywk\clp\seven\pycontest_01>py24 test.py
.
--------------------------------------------------------------
Ran 1 test in 0.391s
OK
[23:28] C:\pywk\clp\seven\pycontest_01>wc -lc seven_seg.py
2 136 seven_seg.py
2 lines, 136 chars including unix-style lineseps (is that cheating on windows?)
No imports.
Guess I'll have to try another tack ;-/
Regards,
Bengt Richter
More information about the Python-list
mailing list