Skip to contents

piecepack_preview() returns a data frame representing a preview layout of the pieces in a standard piecepack set.

Usage

piecepack_preview(cfg = "piecepack")

Arguments

cfg

"piecepack" or perhaps "playing_cards_expansion", "dual_piecepacks_expansion", or "subpack".

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 <- piecepack_preview()
if (requireNamespace("ppcli", quietly = TRUE) &&
    packageVersion("ppcli") >= "0.3.0-2") {
  ppcli::cat_piece(df, annotate = TRUE)
}
#> 6┌───┐   ┌───┐
#>  ☾⃟│☾  │
#> 5│ a │   │ a │
#>  │   │◎ ♛⃟│   │
#> 4├───┼─┰─┼───┤
#>   │ ┃ │
#> 3│ a ┝━╋━┥ a
#>  │   │ ┃ │   │
#> 2└───┴─┸─┴───┘
#>   n⃝ a⃝ 2⃝ n⃞ a⃞ 2⃞ 
#> 1             
#>   ⸸⃝ ☾⃝ ♛⃝ 3⃞ 4⃞ 5⃞ 
#>               
#>    a b c d e f