read_ppn: Read PPN files

View source: R/ppn.R

read_ppnR Documentation

Read PPN files

Description

Read/write Portable Piecepack Notation (PPN) files

Usage

read_ppn(file, parse = TRUE)

write_ppn(games = list(), file = "")

Arguments

file

Filename, if "" will use stdout()

parse

Logical of whether to parse the moves in the ppn file

games

A list of parsed PPN games (as returned by read_ppn())

Value

A list, for each game in the file a list containing info about the game

See Also

plot_move(), animate_game(), and cat_move() for visualizing parsed ppn games.

Examples

 list.files(system.file("ppn", package = "ppgames"))
 file <- system.file("ppn/tic-tac-toe.ppn", package = "ppgames")
 games <- read_ppn(file)
 tmp <- tempfile(fileext = ".ppn")
 write_ppn(games, tmp)
 unlink(tmp)

piecepackr/ppgames documentation built on Jan. 17, 2025, 2:24 p.m.