[EMAIL PROTECTED] wrote:
> The first named clearbrd() which takes no variables, and will reset the
> board to the 'no-queen' position.
(snip)
> The Code:
> #!/usr/bin/env python
> brd = [9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
> def clearbrd():
>       brd = [9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

clearbrd() isn't doing what you want it to.  It should be written as:

  def clearbrd():
      global brd
      brd = [9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

Explanation:
http://www.python.org/doc/faq/programming/#how-do-you-set-a-global-variable-in-a-function

--Ben

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to