get_position | R Documentation |
This function accepts a string containing chess moves in Standard Algebraic Notation (SAN), and an integer specifying a number of ply. It returns a shorter string of chess moves in Long Algebraic Notation (LAN).
get_position(movetext, ply)
movetext |
A string containing chess moves in SAN. |
ply |
An integer specifying a number of ply. |
Positions are represented by the series of chess moves that led to
the position. The ply
parameter specifies which position should be
represented in LAN.
This function is useful for generating positions to be analyzed by a chess engine. The initial position is represented by an empty string "".
The function assumes the input to be valid SAN conforming to the PGN specification. It does not validate the input or check for legal chess moves.
A character vector of chess positions.
movetext <- "1. e4 e5 2. Nf3 Nc6 3. Bb5 a6"
get_position(movetext, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.