alexobviously / bishop

A chess logic package for Dart with flexible variant support
https://pub.dev/packages/bishop
Other
19 stars 8 forks source link

Custom promotion logic #26

Closed alexobviously closed 1 year ago

alexobviously commented 1 year ago

Currently we have a small selection of hardcoded promotion rules - pieces with promotable all get back the same list of promotable pieces. It's possible to define multiple promotion ranks, but it will always be the case that the final rank forces promo and the others are optional (i.e. you also get back a move without a promo piece).

Some cases that aren't supported but should be:

So the requirements are:

I think the solution is to provide a callback for building promotion pieces in the variant, much like how actions work.

alexobviously commented 1 year ago

Implemented in https://github.com/alexobviously/bishop/commit/bd71ef9f008eca02190acec775f029ac002600a8