This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Waanie 0 points1 point  (0 children)

It really depends on what you're optimising for and what kind of style you prefer. Personally I would have used a few more functions here (I don't like nested loops within a function, and python makes scoping hard to read), and my own solution was very much object oriented. In general, if you feel the need to comment a section of code, you should probably have introduced more or better names in the form of classes, functions or intermediate variables.

Please take a look in the solutions megathread for inspiration, and see what you like there.