Closed simoons95 closed 6 months ago
edit: ... whatever is below, but we can iterate later and merge asap :-)
I'd like to see more crisp abstractions here and there :-)
Basically, I think we should aim at the following context:
Exercise 1:
The fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else (including its subcomponents), in accordance with the principle of "information hiding". It may be viewed as a corollary to the principle of least privilege, which dictates that a module possess only the information and resources necessary for its legitimate purpose.
GameOfLifeGrid
abstracts the implementation details of the game of life state itself. The game of life is about moving from one state to the next, so it would make sense to have to implement the following:
def next_generation(grid: GameOfLifeGrid) -> GameOfLifeGrid:
""" Given a GameOfLifeGrid in a given state, returns the next state as a GameOfLifeGrid.
"""
pass
That way, the identity of a GameOfLifeGrid is set, and we can start the exercise. One good subquestion is to ask oneself: what is currently not exposed from the class that we actually need? How to get it?
@simoons95 should we close this PR then ? Let's not leave PR open if the intention is not to merge it