Skip to contents

CRAN Status Badge R-CMD-check codecov

Overview

Installation

remotes::install_github("piecepackr/ppcli")

Examples

library("ppcli")
library("tibble")
df <- tibble(piece_side = "tile_face",
             x=c(0.5, 1.0, 1.5, 2.0, 2.5, 2.5, 3.5, 4.0, 4.0,
                 4.5, 5.5, 6.0, 7.5, 8.0),
             y=c(5.0, 2.5, 1.0, 4.5, 6.0, 3.0, 1.0, 6.5, 2.5,
                 4.0, 6.0, 4.5, 4.0, 2.5),
             rank = c(4, 2, 5, 4, 1, 1, 5, 1, 5, 6, 2, 6, 6, 4) + 1,
             suit = c(4, 5, 0, 1, 1, 5, 4, 2, 5, 5, 6, 6, 4, 0) + 1,
             angle = c(0, 90, 0, 90, 0, 0, 0, 90, 90, 0, 0, 90, 0, 90),
             cfg = "dominoes_white")
cat_piece(df, style = "Game Bit Mono")

Dominoes diagram

Setup for playing Xiangqi with a piecepack

FAQ

Why not in {piecepackr} yet?

The plaintext scheme used by cat_piece() / str_piece() requires more knowledge about the state of previously drawn pieces:

We don’t need to know nearly as much state about how other game pieces were drawn when drawing with {grid}, ggplot2, rayrender, rayvertex, or rgl so it is much more straightforward to simply plot them in sequence using piecepackr::pmap_piece().