LegalMovesFilter
dicechess.engine.movegen.LegalMovesFilter
object LegalMovesFilter
Legal moves filter for Dice Chess.
Implements the Maximum Micro-moves Rule: a player must choose a first move that is part of the longest possible sequence of micro-moves achievable with the rolled dice.
Two types of legal first moves
- King-Capture — any sequence of micro-moves that ends with capturing the opponent's King is always legal, regardless of whether it is 1, 2, or 3 moves long.
- Non-King-Capture — any sequence of micro-moves that does not end with a King capture must achieve the globally optimal length
L*(state, dice).
Rules encoded here
- Normal move — consumes exactly one die of the matching piece type.
- Castling — requires and consumes both the King die (
6) and the Rook die (4) simultaneously. - King-Capture — terminates the game; a King capture contributes its depth to
maxLenbut is not recursed into (the game is over). All branches continue to be searched so thatmaxLenis computed correctly. - Active-color invariance — the active color is kept fixed for every intermediate state produced during a turn; it is not toggled between micro-moves.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LegalMovesFilter.type
Members list
In this article