My program uses the code below to insert an object named Field to a multidimensional array that is created on the fly (at least I thought it would be created):
for x in range(self.width):
for y in range(self.height):
self.board_fields[x][y] = Field()
So board_fields wasn't created on the fly and I got the error:
AttributeError: 'Board' object has no attribute 'board_fields'
How should I define the multidimensional array before putting values into it?
board_fieldsis.