Hellow, just letting people know I've put up some github repo's of my Pthon
projects:
https://github.com/vygr/Python-PCB
https://github.com/vygr/Python-Chess
Regards
Chris
--
https://mail.python.org/mailman/listinfo/python-list
Latest version of Chess test prog for anyone who might be interested.
It does not do en-passon or castling.
Best Regards
Chris
#!/opt/local/bin/pypy -u -tt
#!/opt/local/bin/pypy -u -tt -m cProfile
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Chris Hinsley, GPL V3 License
import sys, os
On 2013-02-15 05:05:27 +, Rick Johnson said:
On Thursday, February 14, 2013 11:48:10 AM UTC-6, Chris Hinsley wrote:
Is a Python list as fast as a bytearray?
Why would you care about that now? Are you running this code on the
Xerox Alto? Excuse me for the sarcasm but your post title has
On 2013-07-22 19:47:33 +, Peter Otten said:
Chris Hinsley wrote:
On 2013-07-22 18:36:41 +, Chris Hinsley said:
Folks, I have this decorator:
def memoize(maxsize):
def _memoize(func):
lru_cache = {}
lru_list = []
Other clues, I use it on a recursive function:
@memoize(64)
def
Folks, I have this decorator:
def memoize(maxsize):
def _memoize(func):
lru_cache = {}
lru_list = []
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key in lru_cache:
lru_list.remove(key)
lru_list.append(
On 2013-07-22 18:36:41 +, Chris Hinsley said:
Folks, I have this decorator:
def memoize(maxsize):
def _memoize(func):
lru_cache = {}
lru_list = []
Other clues, I use it on a recursive function:
@memoize(64)
def next_move(board, colour, alpha, beta, ply):
if ply
On 2013-02-13 23:25:09 +, Chris Hinsley said:
New to Python, which I really like BTW.
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
On 2013-02-14 21:14:03 +, jkn said:
Hi Chris
On Wednesday, 13 February 2013 23:25:09 UTC, Chris Hinsley wrote:
New to Python, which I really like BTW.
Welcome aboard! But aren't you supposed to be writing Forth? ;-)
Cheers
Jon N
Well, I'm experimenting with other
On 2013-02-14 06:05:13 +, Tim Roberts said:
Chris Hinsley wrote:
New to Python, which I really like BTW.
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 surp
On 2013-02-13 23:55:20 +, Oscar Benjamin said:
On 13 February 2013 23:25, Chris Hinsley 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. B
yright (C) 2013 Chris Hinsley, GPL V3 License
import sys
import random
import os
PLY = 3
EMPTY = 0
BLACK = 1
WHITE = 2
NO_CAPTURE = 3
MAY_CAPTURE = 4
MUST_CAPTURE = 5
def piece_type(piece):
return EMPTY if piece == 32 else BLACK if chr(piece) in 'KQRBNP' else WHITE
def display_bo
11 matches
Mail list logo