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

503 abalone #184

Merged
merged 19 commits into from
Dec 19, 2024
Merged

503 abalone #184

merged 19 commits into from
Dec 19, 2024

Conversation

vincentfrochot
Copy link
Member

No description provided.

@vincentfrochot vincentfrochot self-assigned this Sep 11, 2024
@@ -61,16 +61,15 @@ object Board {

}

// TODO Abalone Set
// an Hexagon of width 5 fits in a square of width 9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to have some extra parameter that indicates this isn't a regular 9x9

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you suggested for that one, can you give me an example ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, all of our boards are regular square/rectangular. So when we say a board is of say Width 9 and Height 2, this means that all of the rows are of width 9.

This will remain true for a hexagonal board of the shape that is needed for the game Hex.

However, this won't be true for Abalone as each rows width is variable. So I was suggesting that we add an extra parameter (a boolean) to indicate this difference in shape. Not sure what to call it, but it would be false for all current boards and true for the Abalone board size.

I can't think of an obvious place where this new parameter must be used, but it could well be useful

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if you expect me to do it differently and if I should already consider applying the change to other Board files
Can't we just define something like "if this variable exists then the Board does not have a regular square size" ?
Would avoid modifying other Board.scala files 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this variable exists then the Board does not have a regular square size
Yes exactly this.
I would make it a parameter of the BoardSize class. You could default it true as an input.
This would probably mean you need to edit the constructor of all BoardSize classes in other game logics (and wrapper layer) but thats fine. As its a default parameter it shouldn't require any other code changes.

@vincentfrochot vincentfrochot merged commit 608d1f0 into dev Dec 19, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants