Skip to contents

tibble data frames of setups for 6 chess variants. Data frame output can usually be plotted with pmap_piece(df, default.units = "in").

Usage

chess_chess(
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
)

chess_chess960(
  seed = NULL,
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = NULL
)

chess_fischer_random_chess(
  seed = NULL,
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = NULL
)

chess_horde_chess(
  ...,
  cell_width = getOption("ppdf.chess_cell_width", 1),
  fen = "rnbqkbnr/pppppppp/8/1PP2PP1/PPPPPPPP/PPPPPPPP/PPPPPPPP/PPPPPPPP w kq - 0 1"
)

chess_international_chess(
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
)

chess_jeson_mor(
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = "nnnnnnnnn/9/9/9/9/9/9/9/NNNNNNNNN"
)

chess_monochrome_chess(
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = "RNBQKBNR/PPPPPPPP/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
)

chess_racing_kings(
  cell_width = getOption("ppdf.chess_cell_width", 1),
  ...,
  fen = "8/8/8/8/8/8/krbnNBRK/qrbnNBRQ w - - 0 1"
)

Arguments

cell_width

Width of board cell. Most renderers support 1 or 2.

...

Should be left empty.

fen

A FEN string specifying the piece placement. Only the piece placement portion (the first field) of the FEN string is used.

seed

Seed that determines setup, either an integer or NULL

Value

A tibble::tibble() data frame with the following columns:

  • "piece_side"

  • "suit"

  • "rank"

  • "cfg" (optional, defaults to "piecepack")

  • "x"

  • "y"

  • "angle" (optional, defaults to 0).

This data frame is compatible with piecepackr::render_piece() and likely ppcli::cat_piece().

Examples

df <- chess_international_chess()
if (requireNamespace("ppcli", quietly = TRUE) &&
    packageVersion("ppcli") >= "0.3.0-1") {
  ppcli::cat_piece(df, annotate = TRUE)
}
#>  ┌─┰─┰─┰─┰─┰─┰─┰─┐
#> 8│♜┃♞┃♝┃♛┃♚┃♝┃♞┃♜│
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 7│♟┃♟┃♟┃♟┃♟┃♟┃♟┃♟│
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 6│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 5│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 4│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 3│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 2│♙┃♙┃♙┃♙┃♙┃♙┃♙┃♙│
#>  ┝━╋━╋━╋━╋━╋━╋━╋━┥
#> 1│♖┃♘┃♗┃♕┃♔┃♗┃♘┃♖│
#>  └─┸─┸─┸─┸─┸─┸─┸─┘
#>   a b c d e f g h