diff --git a/DESCRIPTION b/DESCRIPTION index 6602e8f..134e94f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: ppdf Type: Package Title: Board Game Setups -Version: 0.3.0-16 +Version: 0.3.0-17 Authors@R: c(person("Trevor L.", "Davis", role=c("aut", "cre"), email="trevor.l.davis@gmail.com", comment = c(ORCID = "0000-0001-6341-4639"))) diff --git a/NAMESPACE b/NAMESPACE index 27ce704..2941830 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -303,6 +303,7 @@ export(piecepack_thai_checkers) export(piecepack_the_in_crowd) export(piecepack_the_magic_bag) export(piecepack_the_penguin_game) +export(piecepack_three_musketeers) export(piecepack_tic_tac_toe) export(piecepack_tiles) export(piecepack_tornado_vs_trailer_park) diff --git a/NEWS.md b/NEWS.md index ed2bbc4..936a084 100644 --- a/NEWS.md +++ b/NEWS.md @@ -31,6 +31,7 @@ New features + `piecepack_seega()` + `piecepack_tablan()` + `piecepack_tariffs()` + + `piecepack_three_musketeers()` + `piecepack_tic_tac_toe()` + `piecepack_tornado_vs_trailer_park()` + `piecepack_yote()` diff --git a/R/piecepack_games_other.R b/R/piecepack_games_other.R index 9ce9b9b..61cef5e 100644 --- a/R/piecepack_games_other.R +++ b/R/piecepack_games_other.R @@ -83,6 +83,10 @@ piecepack_games_other <- function() { , "``piecepack_quatri()``" , NA_character_ , "https://www.ludism.org/ppwiki/Quatri" + , "Three Musketeers" + , "``piecepack_three_musketeers()``" + , NA_character_ + , "https://boardgamegeek.com/boardgame/21861/three-musketeers" ) } @@ -296,3 +300,23 @@ piecepack_quatri <- function() { ) bind_rows(df_tiles, df_coins) } + +#' @rdname piecepack_games_other +#' @export +piecepack_three_musketeers <- function() { + df_t <- piecepack_rectangular_board(5L, 5L) + df_p <- piecepack_pawns( + suit = c(4L, 3L, 1L), + x = c(1L, 3L, 5L), + y = c(1L, 3L, 5L), + angle = 0 + ) + df_c <- piecepack_coins( + side = "face", + x = rep_len(1:5, length.out = 24L)[-c(1L, 13L)], + y = rep.int(1:5, times = c(4L, 5L, 4L, 5L, 4L)), + suit = rep.int(1:4, c(6L, 6L, 5L, 5L)), + rank = c(1:6, 1:6, 1:5, 1:5) + ) + bind_rows(df_t, df_p, df_c) +} diff --git a/README.md b/README.md index c5004ca..2ee06eb 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ animate_game(game, file = "man/figures/README-relativity.gif", ### Piecepacks -`{ppdf}` supports the following 113 games playable with a piecepack deck (plus possibly additional components): +`{ppdf}` supports the following 114 games playable with a piecepack deck (plus possibly additional components): * [12345ive!](https://boardgamegeek.com/boardgame/154644/12345ive) * [Achi](https://en.wikipedia.org/wiki/Achi_(game)) @@ -332,6 +332,7 @@ animate_game(game, file = "man/figures/README-relativity.gif", * [The "In" Crowd](https://www.ludism.org/ppwiki/TheInCrowd) * [The Magic Bag](https://www.ludism.org/ppwiki/The_Magic_Bag) * [The Penguin Game](https://www.ludism.org/ppwiki/PenguinGame) +* [Three Musketeers](https://boardgamegeek.com/boardgame/21861/three-musketeers) * [Tic-tac-toe](https://en.wikipedia.org/wiki/Tic-tac-toe) * [Tornado vs. Trailer Park](https://www.ludism.org/ppwiki/Tornado_vs._Trailer_Park) * [Tower of Babel AKA (Piecepack) Accordion](https://www.ludism.org/ppwiki/TowerOfBabel) diff --git a/man/piecepack_games_other.Rd b/man/piecepack_games_other.Rd index 8d6dc7f..35cf2d5 100644 --- a/man/piecepack_games_other.Rd +++ b/man/piecepack_games_other.Rd @@ -16,6 +16,7 @@ \alias{piecepack_lines_of_action} \alias{piecepack_lukawan} \alias{piecepack_quatri} +\alias{piecepack_three_musketeers} \title{Setups for other modern games playable with a piecepack} \usage{ piecepack_12345ive() @@ -45,6 +46,8 @@ piecepack_lines_of_action() piecepack_lukawan() piecepack_quatri() + +piecepack_three_musketeers() } \arguments{ \item{seed}{Seed that determines setup, either an integer or \code{NULL}} @@ -70,7 +73,7 @@ A \code{\link[tibble:tibble]{tibble::tibble()}} data frame with the following co This data frame is compatible with \code{\link[piecepackr:render_piece]{piecepackr::render_piece()}} and likely \code{\link[ppcli:cat_piece]{ppcli::cat_piece()}}. } \description{ -\code{tibble} data frames of setups for 14 other games playable with a piecepack. +\code{tibble} data frames of setups for 15 other games playable with a piecepack. Data frame output can usually be plotted with \code{pmap_piece(df, default.units = "in")}. } \details{ @@ -90,6 +93,7 @@ Here are links for more information about the various other games:\tabular{ll}{ Lines of Action \tab \url{https://en.wikipedia.org/wiki/Lines_of_Action} \cr Lukawan \tab \url{https://ludism.org/ppwiki/Lukawan} \cr Quatri \tab \url{https://www.ludism.org/ppwiki/Quatri} \cr + Three Musketeers \tab \url{https://boardgamegeek.com/boardgame/21861/three-musketeers} \cr } } \examples{ diff --git a/tests/testthat/_snaps/piecepack_games_other.md b/tests/testthat/_snaps/piecepack_games_other.md index 1d809a5..64d2f16 100644 --- a/tests/testthat/_snaps/piecepack_games_other.md +++ b/tests/testthat/_snaps/piecepack_games_other.md @@ -386,3 +386,21 @@ └─┸─┴─┸─┘ a b c d +--- + + Code + cat_piece(piecepack_three_musketeers(), annotate = TRUE) + Output + + 5 a⃝─2⃝─3⃝─4⃝─☀⃟ + │ ┃ │ ┃ │ + 4 a⃝━2⃝━3⃝━4⃝━n⃝ + │ ┃ │ ┃ │ + 3 3⃝─4⃝─♛⃟─5⃝─n⃝ + │ ┃ │ ┃ │ + 2 4⃝━5⃝━n⃝━a⃝━2⃝ + │ ┃ │ ┃ │ + 1 ⸸⃟─n⃝─a⃝─2⃝─3⃝ + + a b c d e + diff --git a/tests/testthat/test-games_info.R b/tests/testthat/test-games_info.R index ef5714e..3ef4fcc 100644 --- a/tests/testthat/test-games_info.R +++ b/tests/testthat/test-games_info.R @@ -6,7 +6,7 @@ test_that("*_games() row counts", { expect_equal(nrow(go_games()), 2L) expect_equal(nrow(marble_games()), 0L) expect_equal(nrow(morris_games()), 7L) - expect_equal(nrow(piecepack_games()), 113L) + expect_equal(nrow(piecepack_games()), 114L) expect_equal(nrow(reversi_games()), 2L) expect_equal(nrow(stackpack_games()), 10L) expect_equal(nrow(tarot_games()), 0L) diff --git a/tests/testthat/test-piecepack_games_other.R b/tests/testthat/test-piecepack_games_other.R index 935c1af..c6382e1 100644 --- a/tests/testthat/test-piecepack_games_other.R +++ b/tests/testthat/test-piecepack_games_other.R @@ -25,4 +25,5 @@ test_that("piecepack other games work as expected", { expect_snapshot(cat_piece(piecepack_lines_of_action(), reorient = "all", annotate = TRUE)) expect_snapshot(cat_piece(piecepack_lukawan(), annotate = TRUE)) expect_snapshot(cat_piece(piecepack_quatri(), annotate = TRUE)) + expect_snapshot(cat_piece(piecepack_three_musketeers(), annotate = TRUE)) })