View source: R/get_positions.R
get_positions | R Documentation |
This function takes a string containing chess moves in standard algebraic notation (SAN) and returns a character vector of positions, also in SAN. The initial position is represented by an empty string "". Subsequent positions are represented by the series of chess moves that generated the position. This is mainly useful for generating positions that can be fed to a chess engine for analysis.
get_positions(movetext)
movetext |
A string containing chess moves in SAN. |
The function get_positions
expects the input to be valid SAN that conforms
to the
PGN specification.
It does not perform any checks to ensure that the input is valid and consists
of legal chess moves. Annotations, game termination markers, comments, etc.,
will be removed from the output.
A character vector of chess positions.
movetext <- "1. e4 e5 2. Nf3 Nc6 3. Bb5 a6"
positions <- get_positions(movetext)
print(positions)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.