Every short legal path from one position to a target placement
Source:R/fct_game_tracker.R
find_move_paths.RdSearches all legal move sequences up to max_plies long and returns those
that reach target_placement. Only the placement is compared, because that
is all a screenshot can show - side to move, castling rights, en passant and
the move clocks are not visible on a board and are instead carried forward
by playing the moves.
Arguments
- ctx
A chess.js V8 context from
new_chess_context().- from_fen
The position we are confident about.
- target_placement
The placement field just observed.
- max_plies
Longest sequence to consider.
- cap
Stop once this many distinct paths are found; the caller only needs to distinguish none, one and more-than-one.