I create a Sudoku game in Python.
I have a:
- Cell class – that “holds” the number possibilities
- Cell groups – that holds the cell class instances
I use the groups to run row, col and square functionalities in Sudoku.
Each cell contains all the groups, he belongs to
class Cell:
def __init__(groups):
self.groups = groups
class Group:
def __init__(cells):
self.cells = cells
In this case, I can send a chain reaction when a cell value is changed to all relevent cells via their groups.
Is it a good practice to use cross reference between classes in this manner?