Skip to contents

Write a game to 'PGN'

Usage

gm_write_pgn(game, path = NULL, overwrite = FALSE)

Arguments

game

A gm_game object.

path

Optional output path. If NULL (default), the 'PGN' string is returned invisibly instead of being written.

overwrite

If FALSE (default), error rather than overwrite path.

Value

The 'PGN' string, invisibly. Called for its side effect when path is supplied.

Examples

cat(gm_write_pgn(gm_read_pgn("1. e4 e5 *", text = TRUE)))
#> [Event "gambitR game"]
#> [Site "?"]
#> [Date "????.??.??"]
#> [Round "?"]
#> [White "?"]
#> [Black "?"]
#> [Result "*"]
#> 
#> 1. e4 e5 *