First attempt at a Python prog (Chess)

Chris Hinsley chris.hinsley at gmail.com
Thu Feb 14 02:31:59 CET 2013


On 2013-02-13 23:55:20 +0000, Oscar Benjamin said:

> On 13 February 2013 23:25, Chris Hinsley <chris.hinsley at gmail.com> wrote:
>> New to Python, which I really like BTW.
> 
> Glad to hear it.
> 
>> First serious prog. Hope you like it. I know it needs a 'can't move if your
>> King would be put into check' test. But the weighted value of the King piece
>> does a surprising emergent job.
> [SNIP program]
> 
> Your program looks good. Were you looking for feedback (I'm sure
> someone would give some if so)?
> 
> 
> Oscar

I suppose so yes. I was just 'putting it out there' to see if it was 
interesting/useful to anyone. No doubt there are many Python features I 
could use to improve on this. First thing that occurred to me on 
deciding to try Python was the idea of Generator functions to enumerate 
all the possible moves of a Chess game, and that 'yield' would make the 
prog relatively compact.

I wish Shedskin could cope with them ! PyPy runs it OK.

Chris




More information about the Python-list mailing list