Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Encoding: UTF-8
Package: ppcli
Type: Package
Title: Plaintext Board Game Visualizations
Version: 0.2.0-7
Version: 0.2.0-8
Authors@R: c(person("Trevor L.", "Davis", role=c("aut", "cre"),
email="trevor.l.davis@gmail.com",
comment = c(ORCID = "0000-0001-6341-4639")))
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ New features
* `cat_piece()` and `str_piece()` adds support for the following game pieces (#4):

+ "alquerque" bit and board pieces.
+ "dice_numeral" dice.
+ "marbles" bit and board pieces.

- However we currently do not distinguish between the nine marble bit ranks.
Expand Down
10 changes: 7 additions & 3 deletions R/str_piece.r
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ get_style_combining <- function(style) {
dual_piecepacks_expansion = french_suits_white,
subpack = piecepack_suits,
dice = die_suits,
dice_fudge = die_suits)
dice_fudge = die_suits,
dice_numeral = die_suits)

list(coin = coin, die = die, pawn = pawn)
}
Expand Down Expand Up @@ -186,6 +187,7 @@ get_style_rs <- function(style, big = FALSE) {
chess2 = c("\u265f", "\u265e", "\u265d", "\u265c", "\u265b", "\u265a"),
dice = dominoes_ranks[-1],
dice_fudge = dice_fudge,
dice_numeral = as.character(1:6),
dominoes = dominoes_ranks,
dominoes_black = dominoes_ranks,
dominoes_blue = dominoes_ranks,
Expand Down Expand Up @@ -236,6 +238,7 @@ get_style_ss <- function(style, big = FALSE) {
chess2 = "",
dice = rep_len(" ", 6L),
dice_fudge = rep_len(" ", 6L),
dice_numeral = rep_len(" ", 6L),
dominoes = dominoes_ranks,
dominoes_black = dominoes_ranks,
dominoes_blue = dominoes_ranks,
Expand Down Expand Up @@ -268,8 +271,9 @@ get_style_fg <- function(style) {
chess2 = suit_colors,
checkers1 = suit_colors,
checkers2 = suit_colors,
dice = suit_colors,
dice_fudge = suit_colors,
dice = dice_colors,
dice_fudge = dice_colors,
dice_numeral = dice_colors,
dominoes = rep_len("black", 7L),
dominoes_black = rep_len(dice_colors[2L], 7L),
dominoes_blue = rep_len(dice_colors[4L], 7L),
Expand Down
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ We don't need to know nearly as much state about how other game pieces were draw

* [{piecepackr}](https://github.com/piecepackr/piecepackr)
* [{ppdf}](https://github.com/piecepackr/ppdf)
* [{ppn}](https://github.com/piecepackr/ppn)

### Blog/forum posts

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ We don't need to know nearly as much state about how other game pieces were draw

* [{piecepackr}](https://github.com/piecepackr/piecepackr)
* [{ppdf}](https://github.com/piecepackr/ppdf)
* [{ppn}](https://github.com/piecepackr/ppn)

### Blog/forum posts

Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/_snaps/cat_piece.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,3 +754,15 @@
└─┸─┸─┸─┸─┸─┸─┸─┘


---

Code
df <- tibble(piece_side = "die_face", x = 1:6, y = 1, rank = 1:6, suit = 1:6,
cfg = "dice_numeral")
cat_piece(df)
Output

1⃞ 2⃞ 3⃞ 4⃞ 5⃞ 6⃞



6 changes: 6 additions & 0 deletions tests/testthat/test_cat_piece.r
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,10 @@ test_that("text diagrams", {
df <- rbind(dfx, dff, dfb)
cat_piece(df)
})

# numeral dice
expect_snapshot({
df <- tibble(piece_side = "die_face", x=1:6, y=1, rank=1:6, suit=1:6, cfg="dice_numeral")
cat_piece(df)
})
})