I want to store a node object (Containing stuff like a x & y coordinate as well as a state) in a 2 dimensional array so I can access the object like this:
array_variable[x, y]
Unfortunatly, I do not know how to do this in python as I am quite new to it. Here is the relevant code:
class node:
def init(self, x, y, state):
self.x = x;
self.y = y;
self.state = state;
from node import node;
class grid:
def init(self, x, y):
self.width = x;
self.height = y;
self.g = [x, y];
def set_node(self, x, y, state):
print(len(self.g));
n = node();
n.init(x, y, state);
self.g[x][y] = n;
initneeds to be__init__