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

Pla 982 add bestemshe #185

Merged
merged 8 commits into from
Sep 12, 2024
Merged

Pla 982 add bestemshe #185

merged 8 commits into from
Sep 12, 2024

Conversation

msomatt
Copy link
Member

@msomatt msomatt commented Sep 12, 2024

No description provided.

(situation.board.history.score.p2 > 25) ||
(situation.moves.size == 0)

override def specialDraw(situation: Situation) =
Copy link
Member

Choose a reason for hiding this comment

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

don't you want to change this to false ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured best to leave this clause in (which wont be triggered with regular Bestemshe) but when we get to the point where we are offering FromPosition for all variants then it could be possible to create a position (fen) where the scores start as odd and so a draw is possible. if i remove this code then i think it will just look in winner and award p2 as a winner in these 'tie' situations.

playUciList(
game.getOrElse(Game.apply(variant.Backgammon)),
game.getOrElse(Game.apply(variant.getOrElse(Variant.default))),
Copy link
Member

Choose a reason for hiding this comment

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

Is there a difference here between writing Game.apply(<some_param>) and Game(<some_param>) ?
If not, do you prefer I write the apply in the tests I am currently writing for Abalone ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Both Game.apply(variant) and Game(variant) work here. Personally I prefer Game() to be used when you are instantiating an instance of Game with its paramter-set and call Game.apply when you are explicitly instantiating a Game through an apply method (in this case

def apply(variant: strategygames.togyzkumalak.variant.Variant): Game =
).
Despite that being my personal preference, I don't think this standard is followed throughout the codebase and I have no problem with you doing either approach

@msomatt msomatt merged commit 9c5d1b8 into dev Sep 12, 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.

2 participants