searching a list of lists as a two-dimensional array?

2007-02-11 Thread agent-s
Basically I'm programming a board game and I have to use a list of lists to represent the board (a list of 8 lists with 8 elements each). I have to search the adjacent cells for existing pieces and I was wondering how I would go about doing this efficiently. Thanks -- http://mail.python.org/mailm

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread agent-s
Thanks for the help guys but I'm a newbie at this and from what I understand from the code, it looks like you guys are using a two dimensional array. I am not using a two dimensional array. Basically, it looks like this: [ [' ',' ',' ',' ',' ',' ',' ',' '], [' ',' ',' ',' ',' ',' ',' ',' '], [' ',

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread agent-s
OK I just realized that a list of lists can be accessed in the same way a 2d array would be accessed. Thanks anyways guys. -- http://mail.python.org/mailman/listinfo/python-list

python not returning true

2007-02-13 Thread agent-s
I have a function, generally described as so: def function(args): if condition: if condition2: function(args+1) elif condition3: print "text" return True else: return False which is used in: if function(args):

Re: python not returning true

2007-02-13 Thread agent-s
On Feb 13, 9:37 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 14, 4:15 pm, "agent-s" <[EMAIL PROTECTED]> wrote: > > > I have a function, generally described as so: > > > def function(args): > > if condition:

Re: python not returning true

2007-02-22 Thread agent-s
Wow. I didn't realize you guys took this so seriously. -- http://mail.python.org/mailman/listinfo/python-list