Closed veloce closed 1 year ago
How should ambiguities be handled? What about move annotations?
You mean annotation like in a PGN format? This should be handled by the PGN parser.
Here it should only parse SAN according to a Position (see corresponding class). Returned move should be a legal move according to that position or null (so there's no ambiguities).
We need the ability to parse SAN for a
Position
.Implement a method in
Position
class, whose signature isMove? parseSAN(String san)
. The move returned should be a legal move of the position, if any.It should support crazyhouse and drop moves too.
Example implementation on: https://github.com/niklasf/chessops/blob/f287455e1cc83925c9f759f3c8829e2ca89d243f/src/san.ts#L82