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"
)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().
Details
Here are links for more information about the various games:
| Game | URL |
| (International) Chess | https://en.wikipedia.org/wiki/Chess |
| Fischer Random Chess AKA Chess960 | https://www.chessvariants.com/diffsetup.dir/fischer.html |
| Horde Chess | https://lichess.org/variant/horde |
| Jeson Mor | https://en.wikipedia.org/wiki/Jeson_Mor |
| Monochrome Chess | https://wunderland.com/WTS/Andy/Games/monochess.html |
| Racing Kings | https://www.chessvariants.com/diffobjective.dir/racing.html |
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