fjank / github-workflow-kata

Game of life kata set in a github workflow environment
0 stars 0 forks source link

Refactor the Grid class #29

Open fjank opened 3 years ago

fjank commented 3 years ago

now the internal representation is a char[][]. Old and moldy for loops and Math min/max to find neighbours. 🤮 I would like to have the grid represented as Linked objects/graphs instead. e.g. Cell: Cell north Cell east Cell south Cell west etc. or perhaps: Cell: Map<Location, Cell> neighbours.

This will make the neighbour lookup super simple and quite easy to read. A bit more complex during initial construction, but I can live with that. As an added bonus, this will also add support for non square grids, strange coordinate systems (pentagons/hexagons/triangular etc), n-dimensional grids, should I ever fancy to test that out.

netbrain commented 3 years ago

Quite often, less is more. But im looking forward to see this implementation.