On Sun, Oct 17, 2010 at 7:06 PM, Shlomi Fish <[email protected]> wrote:
> On Tuesday 12 October 2010 20:48:07 cool-RR wrote: > > On Tue, Oct 12, 2010 at 8:12 PM, Shlomi Fish <[email protected]> wrote: > > > Hi all, > > > > > > I've written a solver for Kakurasu (see > > > http://brainbashers.com/kakurasu.asp) based on lp_solve, an LGPLed > > > Linear Programming solver, and you can currently find it here: > > > > > > http://bitbucket.org/shlomif/lp-based-puzzle-solvers > > > > > > I'd like to get some input about it before I release its first > > > version, announce it on Freshmeat.net and all that Jazz. Some points > > > to consider: > I see the algorithm there is non-trivial, and I don't have time to really dive into it. I have a few general notes: 1. Use new-style classes. (Inherit every class from `object`.) 2. '''The solver instance itself.''' This docstring doesn't help much. I wouldn't use the word instance other, you know that word is used for actual objects. 3. '''A class method that parses the input file and constructs an object.'''. I think this is bad writing style. Much better would be '''Parse the input file and create a Solver.''' 'I don't know if you read them, but you should be familiar with PEP 8 <http://www.python.org/dev/peps/pep-0008/> and PEP 257 <http://www.python.org/dev/peps/pep-0257/>. (I don't follow them completely and you don't have to follow them completely either, but in most things they are good.) I want to note that most of the advice I gave here is about style; I understand if it's not that important to you. I personally care a lot about style, but many Python programmers don't. You can decide yourself which path you want to follow. Ram.
_______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
