Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow More Board Types for Some Variants #158

Open
JonKo314 opened this issue Jan 2, 2024 · 5 comments
Open

Allow More Board Types for Some Variants #158

JonKo314 opened this issue Jan 2, 2024 · 5 comments

Comments

@JonKo314
Copy link
Collaborator

JonKo314 commented Jan 2, 2024

What

Looking at our currently supported Go variants, there are only a few which don't work with a graph-like board right away:

  • Keima Go
  • Pyramid Go

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:

  • Capture Go
  • Freeze Go
  • Phantom Go
  • Thue-Morse Go
  • Tetris Go

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:

  • Duplicate the variants with graph-like boards
  • Use graph-like boards where possible (this probably has a negative impact on performance, but maybe not a significant one)
  • Add a Board interface or abstract class, that ensures the necessary functionalities (detecting chains, etc.) are implemented, but allow different implementations
  • Anything else?

Depending on how it's done, we might have to think about what we do with the current implementations. Do we keep them?

@benjaminpjones
Copy link
Collaborator

benjaminpjones commented Jan 2, 2024

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 Arrays 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)

@JonKo314
Copy link
Collaborator Author

JonKo314 commented Jan 2, 2024

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.

@benjaminpjones
Copy link
Collaborator

In fact, I've got a graph branch that does exactly this! Fillable Graph class here: 86d8a0e#diff-5d3c16a2ad75c17994d1b1eed708d6ad72008638e25833c8c64db2db00e3e91b There might be some reason why I haven't merged, but I can't remember.

@benjaminpjones
Copy link
Collaborator

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

@merowin
Copy link
Collaborator

merowin commented Jan 4, 2024

I think a Board Interface / Abstract class sounds nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants