Using Python 3.7.0, I've programmed a 'Game of Life' simulator. The output is displayed using tkintertkinter
. It's not meant to be limited to just Game of Life, though, as it's meant to also be used for a simple physics simulation project.
I also have a problem with trying to import this module and changing the behaviour of ‘Cell’Cell
. To do this, I have been told to make a subclass, and override when needed. However, ‘Grid’Grid
creates new cells using the original ‘Cell’Cell
constructor, so any changes I make won’t affect the cells GridGrid
creates.
Is there any way I can edit the behaviour of CellCell
and get GridGrid
to make the new objects, without rewriting lots of functions?
Using Python 3.7.0, I've programmed a 'Game of Life' simulator. The output is displayed using tkinter. It's not meant to be limited to just Game of Life, though, as it's meant to also be used for a simple physics simulation project.
I also have a problem with trying to import this module and changing the behaviour of ‘Cell’. To do this, I have been told to make a subclass, and override when needed. However, ‘Grid’ creates new cells using the original ‘Cell’ constructor, so any changes I make won’t affect the cells Grid creates.
Is there any way I can edit the behaviour of Cell and get Grid to make the new objects, without rewriting lots of functions?
Using Python 3.7.0, I've programmed a 'Game of Life' simulator. The output is displayed using tkinter
. It's not meant to be limited to just Game of Life, though, as it's meant to also be used for a simple physics simulation project.
I also have a problem with trying to import this module and changing the behaviour of Cell
. To do this, I have been told to make a subclass, and override when needed. However, Grid
creates new cells using the original Cell
constructor, so any changes I make won’t affect the cells Grid
creates.
Is there any way I can edit the behaviour of Cell
and get Grid
to make the new objects, without rewriting lots of functions?
I also have a problem with trying to import this module and changing the behaviour of ‘Cell’. To do this, I have been told to make a subclass, and override when needed. However, ‘Grid’ creates new cells using the original ‘Cell’ constructor, so any changes I make won’t affect the cells Grid creates.
Is there any way I can edit the behaviour of Cell and get Grid to make the new objects, without rewriting lots of functions?
I also have a problem with trying to import this module and changing the behaviour of ‘Cell’. To do this, I have been told to make a subclass, and override when needed. However, ‘Grid’ creates new cells using the original ‘Cell’ constructor, so any changes I make won’t affect the cells Grid creates.
Is there any way I can edit the behaviour of Cell and get Grid to make the new objects, without rewriting lots of functions?
I'm looking for feedback on how to make the code faster (the glider gun provided slows down after making about 3 gliders), as well as error-handling handling. I haven't implemented any yet, but I'm not sure how much I need to account for - does every function need a 'trytry
...except'except
statement? Only every init__init__
function? Any feedback in this area would be greatly appreciated.
The code from a previous Q:Here is Conway's Game Of Life in Python 3 using tkinterthe code from a previous Q I. I used this as a reference, but I tried my best not to directly copy it. However, some elements are quite similar to it (for example, both have 3 classes of Square/Cell, Grid and App).
I'm looking for feedback on how to make the code faster (the glider gun provided slows down after making about 3 gliders), as well as error-handling. I haven't implemented any yet, but I'm not sure how much I need to account for - does every function need a 'try...except' statement? Only every init function? Any feedback in this area would be greatly appreciated.
The code from a previous Q: Conway's Game Of Life in Python 3 using tkinter I used this as a reference, but I tried my best not to directly copy it. However, some elements are quite similar to it (for example, both have 3 classes of Square/Cell, Grid and App).
I'm looking for feedback on how to make the code faster (the glider gun provided slows down after making about 3 gliders), as well as error handling. I haven't implemented any yet, but I'm not sure how much I need to account for - does every function need a try
...except
statement? Only every __init__
function? Any feedback in this area would be greatly appreciated.
Here is the code from a previous Q . I used this as a reference, but I tried my best not to directly copy it. However, some elements are quite similar to it (for example, both have 3 classes of Square/Cell, Grid and App).