Repository navigation
Conversation
Paste or open a PGN on the move list to replay it as Pass & Play, including games that start from a FEN, then step through the moves with the existing review controls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chess: load a PGN to review a game
The move list already copies and downloads a game as PGN. This adds the other direction: paste a PGN, or open a
.pgnfile, and step through it on the board.What changes
;line comments,$1-style glyphs, and parenthetical variations are ignored. A[FEN]tag is honoured, so a game that did not start from the initial array still plays.Tests
Nf3,O-O,e8Q,e2e4) as well as{from, to}.parsePgn/replayPgncover tags, glued move numbers, comments, variations, a FEN start, an illegal move, a FEN the engine will not load, and a round-trip of Scholar's mate through export then import.npm test: 150 passed.npm run buildsucceeds.Test plan
cd src/chess && npm ci && npm test && npm run build.pgnfile that includes{comments}, a(variation), and a result; confirm the variation is not played[FEN]tag that is not the starting positionNot included
P-K4) is not read.Demo