Chess module blog

W

Will McGugan

Hi folks,

I have just blogged about a Python chess module of mine that I wrote a
while back. I plan on using it for a commerical project, but making the
module open source. So I would be interested in comments / advice
reagarding programming style and also optimization.

http://www.willmcgugan.com/2006/06/18/chesspy/

Regards,

Will McGugan
 
F

faulkner

make psyco entirely optional by putting it in a try/except block.
change INITIAL_BOARD to be a triple-quoted string.
you seem to mostly follow pep8, which is all most folks ask, but i
really like this style for docstrings:
def test():
''' hello,
this text and the quotes line up
very nicely
in a monospace font.
'''
return
pep8 says function names shouldn't be capitalized, and use underscores
to separate words, so they can be distinguished from classes [which are
CamelCase] quickly.

i would make a few small functions inside adjudicate for each cmd case,
then make a dict mapping 'fen' to the function fen, 'reset' to the
function reset, etc. faster and more modular.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top