alquerque_board() returns an alquerque board.
alquerque_bits() returns alquerque pieces.
Usage
alquerque_board(x0 = 1, y0 = 1, ..., suit = "green")
alquerque_bits(
...,
suit = 1:6,
x = as.double(1:6),
y = 1,
angle = 0,
length.out = NA_integer_
)Arguments
- x0
X coordinate for the center of the first point
- y0
Y coordinate for the center of the first point
- ...
Should be left empty.
- suit
Suit value (color) of board/bit.
1Lis "red",2Lis "black",3Lis "green",4Lis "blue",5Lis "yellow", and6Lis "white". Will be coerced bypiece_suit().- x, y
Cartesian coordinates (numeric vectors)
- angle
Rotation of piece (numeric vector of degrees, counter-clockwise). Will be coerced by
piece_angle().- length.out
The number of pieces. Not needed if all the arguments are the same length (or of length one) and this length is the same as the number of desired pieces.
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 <- alquerque_board()
if (requireNamespace("ppcli", quietly = TRUE) &&
packageVersion("ppcli") >= "0.2.0-1") {
ppcli::cat_piece(df)
}
#> ┌─┬─┬─┬─┐
#> │╲│╱│╲│╱│
#> ├─┼─┼─┼─┤
#> │╱│╲│╱│╲│
#> ├─┼─┼─┼─┤
#> │╲│╱│╲│╱│
#> ├─┼─┼─┼─┤
#> │╱│╲│╱│╲│
#> └─┴─┴─┴─┘
#>
#>