get_moves: Get the chess moves from a character vector containing...

View source: R/get_moves.R

get_movesR Documentation

Get the chess moves from a character vector containing movetext

Description

Given a character vector of movetext, return a list of character vectors each containing moves in long algebraic notation (LAN).

Usage

get_moves(movetext)

Arguments

movetext

A character vector of movetext in SAN format.

Details

The movetext field of a PGN file contains chess moves in standard algebraic notation (SAN), along with optional annotations and comments. The get_moves() function extracts the individual moves and converts them to long algebraic notation (LAN). The movetext vectors are typically obtained from a PGN file using the get_pgn() function.

Value

A list of character vectors, where each vector contains the LAN format moves of the corresponding movetext.

See Also

  • get_pgn() to get the movetext and other data from a PGN file.

  • clean_movetext() to remove comments and annotations from movetext.

Examples

movetext <- c('1. e4 {Best by test.} e5', '1. h3?! h6')
get_moves(movetext)

dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.