Closed JonKo314 closed 2 months ago
Note: I wrote group_utils in a way that it doesn't depend directly on Grid
. One could implement a Fillable
that represents a graph, and it should drop into Baduk
quite easily.
Re: what to do with old code: I'll try not to be too attached to Grid, but in addition to Array
s being more cache friendly, it can also be nice for readability to use coordinates instead of node IDs board.at({x: 3, y: 3})
vs. board.at(41)
Noted.
It's not just about the code though, it's also about old games and configs. Although it wouldn't be too bad to drop all games at this point.
In fact, I've got a graph
branch that does exactly this! Fillable Graph
class here: https://github.com/govariantsteam/govariants/commit/86d8a0ecf98091cf70f6ac4595844e65d008bcf2#diff-5d3c16a2ad75c17994d1b1eed708d6ad72008638e25833c8c64db2db00e3e91b There might be some reason why I haven't merged, but I can't remember.
it's also about old games and configs
IMO it's good to keep the grid configs around.. It's a lot easier to grep { width: 9, height: 9 } than a list of 81 nodes and 144 edges
I think a Board Interface / Abstract class sounds nice.
Should we close this as done? (Freeze Go is still on my list though)
What
Looking at our currently supported Go variants, there are only a few which don't work with a graph-like board right away:
But other ones could be easily played with graph-like boards in theory, yet they can't, because they extend the
Baduk
variant, which only allows grid boards:It would be nice, if we allowed those variants to be played on other boards too.
How
But there are different ways to achieve this:
Board
interface or abstract class, that ensures the necessary functionalities (detecting chains, etc.) are implemented, but allow different implementationsDepending on how it's done, we might have to think about what we do with the current implementations. Do we keep them?