On 2014-04-30 16:15, Mark H Harris wrote:
On 4/30/14 8:28 AM, Chris Hinsley wrote:
On 2013-02-15 05:05:27 +, Rick Johnson said:
First of all your naming conventions suck. You've used the "interface"
style for every function in this game so i can't /easily/ eyeball
parse the /real/ interfac
On 4/30/14 8:28 AM, Chris Hinsley wrote:
On 2013-02-15 05:05:27 +, Rick Johnson said:
First of all your naming conventions suck. You've used the "interface"
style for every function in this game so i can't /easily/ eyeball
parse the /real/ interface functions from the helper functions -- an
perplexed
me:
"First attempt at a Python prog (Chess)"Okay, but how does that translate to:
"The fastest, most efficient, most brain fricked python code ever
released in the form of a game, that just happens to look an awful lot
like C source"?
http://en.wikipedia.or
Just a minor suggestion:
def display_board(board):
print ' a b c d e f g h'
print '+---+---+---+---+---+---+---+---+'
for row in range(8):
for col in range(8):
piece = board[row * 8 + col]
if piece_type[piece] == WHITE:
print '| \x1b[31;0
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.
New version with
On 2013-02-15, MRAB wrote:
> On 2013-02-15 16:17, Neil Cerutti wrote:
>> On 2013-02-15, Oscar Benjamin wrote:
>>> if score > best_score or best_score is None:
>>
>> You need the None check first to avoid an exception from the
>> comparison.
>
> Only in Python 3.
It is a more difficult to find bu
On Mon, Feb 18, 2013 at 9:15 PM, Tim Roberts wrote:
> Chris Hinsley wrote:
>>
>>Is a Python list as fast as a bytearray ?
>
> Python does not actually have a native array type. Everything in your
> program that looked like an array was actually a list.
How do you mean?
>>> isinstance(bytearray
On Mon, 18 Feb 2013 20:15:28 -0800, Tim Roberts wrote:
> Chris Hinsley wrote:
>>
>>Is a Python list as fast as a bytearray ?
>
> Python does not actually have a native array type. Everything in your
> program that looked like an array was actually a list.
Actually it does, but you have to impo
Chris Hinsley wrote:
>
>Is a Python list as fast as a bytearray ?
Python does not actually have a native array type. Everything in your
program that looked like an array was actually a list.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinf
On 15 February 2013 15:49, Chris Angelico wrote:
> On Sat, Feb 16, 2013 at 2:36 AM, Tim Golden wrote:
>> How true. This last time, my team split into two: one half
>> to handle the display, the other working on the algorithm. We
>> ended up having to draw a really simple diagram on the back of
>>
"Only in Python 3."
Use best practices always, not just when you have to.
*Matt Jones*
On Fri, Feb 15, 2013 at 11:52 AM, MRAB wrote:
> On 2013-02-15 16:17, Neil Cerutti wrote:
>
>> On 2013-02-15, Oscar Benjamin wrote:
>>
>>> if score > best_score or best_score is None:
>>>
>>
>> You need the
On 2013-02-15 16:17, Neil Cerutti wrote:
On 2013-02-15, Oscar Benjamin wrote:
if score > best_score or best_score is None:
You need the None check first to avoid an exception from the
comparison.
Only in Python 3.
if best_score is None or score > best_score:
--
http://mail.python.org/m
On Sat, Feb 16, 2013 at 2:36 AM, Tim Golden wrote:
How true. This last time, my team split into two: one half
to handle the display, the other working on the algorithm. We
ended up having to draw a really simple diagram on the back of
an envelope with the x,y pairs written out and pass it back
a
Tim Golden writes:
> On 15/02/2013 13:11, Oscar Benjamin wrote:
> > On 15 February 2013 11:36, Tim Golden wrote:
> >> And the "how shall we represent the board?" question is pretty
> >> much the first thing any team asks themselves. And you always get
> >> someone in favour of lists of lists, someo
On 2013-02-15, Oscar Benjamin wrote:
> if score > best_score or best_score is None:
You need the None check first to avoid an exception from the
comparison.
if best_score is None or score > best_score:
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Feb 16, 2013 at 2:36 AM, Tim Golden wrote:
> How true. This last time, my team split into two: one half
> to handle the display, the other working on the algorithm. We
> ended up having to draw a really simple diagram on the back of
> an envelope with the x,y pairs written out and pass it
On 15/02/2013 13:11, Oscar Benjamin wrote:
> On 15 February 2013 11:36, Tim Golden wrote:
>> And the "how shall we represent the board?" question is pretty
>> much the first thing any team asks themselves. And you always
>> get someone in favour of lists of lists, someone for one long
>> list,
>
On 15 February 2013 11:36, Tim Golden wrote:
> On 15/02/2013 11:22, Oscar Benjamin wrote:
>> Why not make board a list of lists. Then you can do:
>>
>> for row in board:
>> for piece in row:
>>
>> rather than using range().
>>
>> Or perhaps you could have a dict that maps position tuples to pi
On 15/02/2013 11:22, Oscar Benjamin wrote:
> Why not make board a list of lists. Then you can do:
>
> for row in board:
> for piece in row:
>
> rather than using range().
>
> Or perhaps you could have a dict that maps position tuples to pieces,
> e.g.: {(1, 2): 'k', ...}
I'm laughing sligh
On 13 February 2013 23:25, 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 surprising emergent job.
>
> #!/usr/bin/
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 perplexed me:
"First attempt at a Pyt
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 things too
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
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 14, 2013 at 10:48 AM, Chris Hinsley wrote:
> Is a Python list as fast as a bytearray ? I didn't copy a C prog BTW !
>>> from timeit import Timer
>>> t1 = Timer("board[36] = board[20]; board[20] = ' '", "board =
>>> bytearray('RNBQKBNR
>>> p
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 surprising emergent job
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 surprising emergent job.
It looks a little like a C program ported
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. But the weighted value
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. But the weighted value of the King piece
> does a surprising emergent job
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.
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# Copyright (C) 2013 C
29 matches
Mail list logo