0

how do i create a gridline based on classes and objects?

I'm quite new with this, so im just shooting this question out here. I am going to make a simulation for a game called "game of life" about cells' life. And after creating a class for cells i am going to create a gridline where i add (and create) cell-objects that equals the amount of rows and columns, so my question is does anyone know or have any tips to how i can do that?

11th Oct 2017, 2:04 PM
Elinor
1 Odpowiedź
+ 1
Try using a for ... in loop to create and fill the lists. This way you could just access any element by using: listName[x][y].func_or_property()
29th Jun 2019, 5:00 PM
Merijn Willemsen
Merijn Willemsen - avatar