Re: New Python chess module
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: New Python chess module

From: Will McGugan <news@NOwillmcguganSPAM.com>
Date: Fri Sep 30 2005 - 16:52:18 CEST

Pekka Karjalainen wrote:

>
> I have one minor point. It looks like your test whether the location is on
> the board is needlessly complex. Python understands multiple comparisons
> like in mathematical notation, and not like in e.g. C language. This
> snippet shows what I mean:
>
>
>>>>[x for x in range(10) if 2<x<7] # 2<x<7 means 2<x and x<7
>
> [3, 4, 5, 6]
>
> Read about it in the reference:
> http://www.python.org/doc/2.4.2/ref/comparisons.html
>

Thanks. I was aware of that, I've just never got in to the habbit of
using it..

Will McGugan

-- 
http://www.willmcgugan.com
"".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in 
"jvyy*jvyyzpthtna^pbz")
Received on Sat Oct 15 04:00:20 2005