FA-82664 / Chess move legality / Member archive
Enemy piece of the same type forces a disambiguator · case 04
With a black knight on f3, the white move Nb1-d2 is written "Nbd2".
Case contract
Input: {"board", "from", "to"} for a knight, bishop, rook, queen or king move. Return SAN (no check suffix): upper-case piece letter, then a disambiguator only if another same-colour piece of the same type could also reach the target (sliders need a clear path): the origin file if it is unique among those pieces, else the origin rank if unique, else the full origin square; then "x" if the target is occupied; then the target.
Why this case matters
Exported PGN must be re-readable; a wrong disambiguator makes the game unreplayable.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| enemy knight irrelevant | "Nbd2" | "Nd2" | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗