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

How to configure legal moves? #117

Open
rabestro opened this issue Sep 13, 2024 · 1 comment
Open

How to configure legal moves? #117

rabestro opened this issue Sep 13, 2024 · 1 comment

Comments

@rabestro
Copy link

In Dice Chess, the King can move to a square that is under attack.

I want to use the library for Dice Chess game. How I can configure it?

https://dicechess.com/rules

@bhlangonijr
Copy link
Owner

chesslib doesn't natively support Dice Chess, but you can implement it with some additional logic. You could create a new class and method (e.g., DiceMoveGenerator#generateLegalMoves(Board)) that calls MoveGenerator#generatePseudoLegalMoves(Board). Instead of using Board#isMoveLegal to filter out illegal moves, you can write a custom method that allows moves that would normally be considered illegal, such as the king moving into an attacked square.

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

2 participants