Jim Hodgen wrote:
I am learning Python with a minesweeper-engine project. Future
activities turn my attention to exploring the use of dictionaries as
sparse matrices, hence the representation of the gameboard.
Why can't I fill the dictionary-as-a-matrix with an instance of class
Square? Wh
On Thu, Dec 4, 2008 at 3:54 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:
> These are all class level variables so they will be shared if you
> create more than one instance of the class. That's probably
> not what you want?. You should initialise them inside an __init__
> method if you want each squa
"Jim Hodgen" <[EMAIL PROTECTED]> wrote
Why can't I fill the dictionary-as-a-matrix with an instance of
class
Square?
You can but you are not trying to do that in your code.
You are assigning Square to the class that contains the
dictionary, not the dictionary itself.
class Square:
mined
I am learning Python with a minesweeper-engine project. Future
activities turn my attention to exploring the use of dictionaries as
sparse matrices, hence the representation of the gameboard.
Why can't I fill the dictionary-as-a-matrix with an instance of class
Square? Why do I need a custo