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: ppdf
Type: Package
Title: Board Game Setups
Version: 0.3.0-15
Version: 0.3.0-16
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
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export(checker_international_checkers)
export(checker_italian_checkers)
export(checker_jamaican_checkers)
export(checker_julgonu)
export(checker_kangaroo)
export(checker_lasca)
export(checker_lines_of_action)
export(checker_malaysian_checkers)
Expand Down Expand Up @@ -243,10 +244,12 @@ export(piecepack_jamaican_checkers)
export(piecepack_japan)
export(piecepack_japanese_chess)
export(piecepack_julgonu)
export(piecepack_kangaroo)
export(piecepack_kings_valley)
export(piecepack_klondike)
export(piecepack_lab_rats)
export(piecepack_landlocked)
export(piecepack_leapfrog)
export(piecepack_ley_lines)
export(piecepack_lines_of_action)
export(piecepack_ludo)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ New features
* The following functions generate data frames to setup checkers sets (#49):

+ `checker_dodgem()`
+ `checker_kangaroo()`

* The following functions generate data frames to setup cubes (#76):

Expand All @@ -23,7 +24,9 @@ New features
+ `piecepack_achi()`
+ `piecepack_dara()`
+ `piecepack_dodgem()`
+ `piecepack_kangaroo()`
+ `piecepack_kings_valley()`
+ `piecepack_leapfrog()`
+ `piecepack_preview()`
+ `piecepack_seega()`
+ `piecepack_tablan()`
Expand Down
8 changes: 8 additions & 0 deletions R/checker_games_other.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ checker_games_other <- function() {
, "``checker_julgonu()``"
, NA_character_
, "https://en.wikipedia.org/wiki/Jul-Gonu"
, "Kangaroo"
, "``checker_kangaroo()``"
, NA_character_
, "https://boardgamegeek.com/boardgame/6132/kangaroo-the-jumping-game"
, "Lines of Action"
, "``checker_lines_of_action()``"
, NA_character_
Expand Down Expand Up @@ -133,6 +137,10 @@ checker_julgonu <- function(cell_width = getOption("ppdf.checker_cell_width", 1)
to_checkers(piecepack_julgonu(), cell_width, piece_side = "board_back", suit = 2L)
}

#' @rdname checker_games_other
#' @export
checker_kangaroo <- checker_breakthrough

#' @rdname checker_games_other
#' @export
checker_lines_of_action <- function(cell_width = getOption("ppdf.checker_cell_width", 1)) {
Expand Down
27 changes: 27 additions & 0 deletions R/piecepack_games_other.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@ piecepack_games_other <- function() {
, "``piecepack_evade()``"
, NA_character_
, "https://www.ludism.org/ppwiki/Evade"
, "Kangaroo"
, "``piecepack_kangaroo()``"
, NA_character_
, "https://boardgamegeek.com/boardgame/6132/kangaroo-the-jumping-game"
, "King's Valley"
, "``piecepack_kings_valley()``"
, NA_character_
, "https://www.logygames.com/english/kingsvalley.html"
, "Leapfrog"
, "``piecepack_leapfrog()``"
, NA_character_
, "https://youtu.be/LWuVDFmPkZs"
, "Lines of Action"
, "``piecepack_lines_of_action()``"
, NA_character_
Expand Down Expand Up @@ -177,6 +185,10 @@ piecepack_dodgem <- function(nrows = 6L, variant = "vout") {
#' @export
piecepack_evade <- function() piecepack_rectangular_board(ncols = 6, nrows = 6)

#' @rdname piecepack_games_other
#' @export
piecepack_kangaroo <- piecepack_breakthrough

#' @rdname piecepack_games_other
#' @export
piecepack_kings_valley <- function(variant = "standard") {
Expand Down Expand Up @@ -210,6 +222,21 @@ piecepack_kings_valley <- function(variant = "standard") {
df
}

#' @rdname piecepack_games_other
#' @export
piecepack_leapfrog <- function() {
df_t <- piecepack_rectangular_board(8L, 6L)
df_c <- piecepack_coins(
side = "back",
x = rep.int(1:6, 4L),
y = rep(c(8L, 7L, 2L, 1L), each = 6L),
suit = rep(c(1L, 2L, 3L, 4L), each = 6L),
rank = rep.int(1:6, 4L),
angle = rep(c(180, 180, 0, 0), each = 6L)
)
bind_rows(df_t, df_c)
}

#' @rdname piecepack_games_other
#' @export
piecepack_grasshopper <- function() {
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ animate_game(game, file = "man/figures/README-relativity.gif",

### <a name="checkers">Checkers Sets</a>

`{ppdf}` supports the following 32 games playable with a (possibly non-8x8) checkers set:
`{ppdf}` supports the following 33 games playable with a (possibly non-8x8) checkers set:

* [(American) Checkers AKA (English) Draughts](https://en.wikipedia.org/wiki/Draughts)
* [American Pool Checkers](https://draughts.github.io/american-pool-checkers.html)
Expand All @@ -191,6 +191,7 @@ animate_game(game, file = "man/figures/README-relativity.gif",
* [Italian Checkers AKA Italian Draughts](https://en.wikipedia.org/wiki/Italian_draughts)
* [Jamaican Checkers AKA Jamaican Draughts](https://web.archive.org/web/20230605023244/http://poolcheckers.com/jamaica/)
* [Jul-Gonu](https://en.wikipedia.org/wiki/Jul-Gonu)
* [Kangaroo](https://boardgamegeek.com/boardgame/6132/kangaroo-the-jumping-game)
* [Lasca](http://www.lasca.org)
* [Lines of Action](https://en.wikipedia.org/wiki/Lines_of_Action)
* [Malaysian Checkers AKA Singaporean Checkers](https://brainking.com/en/GameRules?tp=31)
Expand Down Expand Up @@ -230,7 +231,7 @@ animate_game(game, file = "man/figures/README-relativity.gif",

### <a name="piecepack">Piecepacks</a>

`{ppdf}` supports the following 111 games playable with a piecepack deck (plus possibly additional components):
`{ppdf}` supports the following 113 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))
Expand Down Expand Up @@ -286,9 +287,11 @@ animate_game(game, file = "man/figures/README-relativity.gif",
* [Jamaican Checkers AKA Jamaican Draughts](https://web.archive.org/web/20230605023244/http://poolcheckers.com/jamaica/)
* [Japan](https://www.ludism.org/ppwiki/Japan)
* [Jul-Gonu](https://www.ludism.org/ppwiki/JulGonu)
* [Kangaroo](https://boardgamegeek.com/boardgame/6132/kangaroo-the-jumping-game)
* [King's Valley](https://www.logygames.com/english/kingsvalley.html)
* [Lab Rats](https://www.ludism.org/ppwiki/LabRats)
* [Landlocked](https://www.ludism.org/ppwiki/Landlocked)
* [Leapfrog](https://youtu.be/LWuVDFmPkZs)
* [Ley Lines](https://www.ludism.org/ppwiki/LeyLines)
* [Lines of Action](https://en.wikipedia.org/wiki/Lines_of_Action)
* [Ludo](https://en.wikipedia.org/wiki/Ludo_(board_game))
Expand Down
6 changes: 5 additions & 1 deletion man/checker_games_other.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion man/piecepack_games_other.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions tests/testthat/_snaps/checker_games_other.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@
└─┸─┸─┸─┘


---

Code
cat_piece(checker_kangaroo())
Output
┌─┰─┰─┰─┰─┰─┰─┰─┐
│⛂┃⛂┃⛂┃⛂┃⛂┃⛂┃⛂┃⛂│
┝━╋━╋━╋━╋━╋━╋━╋━┥
│⛂┃⛂┃⛂┃⛂┃⛂┃⛂┃⛂┃⛂│
┝━╋━╋━╋━╋━╋━╋━╋━┥
│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
┝━╋━╋━╋━╋━╋━╋━╋━┥
│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
┝━╋━╋━╋━╋━╋━╋━╋━┥
│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
┝━╋━╋━╋━╋━╋━╋━╋━┥
│ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │
┝━╋━╋━╋━╋━╋━╋━╋━┥
│⛀┃⛀┃⛀┃⛀┃⛀┃⛀┃⛀┃⛀│
┝━╋━╋━╋━╋━╋━╋━╋━┥
│⛀┃⛀┃⛀┃⛀┃⛀┃⛀┃⛀┃⛀│
└─┸─┸─┸─┸─┸─┸─┸─┘


---

Code
Expand Down
48 changes: 48 additions & 0 deletions tests/testthat/_snaps/piecepack_games_other.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,30 @@
└─┸─┴─┸─┘
a b c d

---

Code
cat_piece(piecepack_kangaroo(), annotate = TRUE)
Output
┌─┰─┬─┰─┬─┰─┬─┰─┐
8│ɐ⃞┃☀⃝│☀⃝┃☀⃝│☽⃝┃☽⃝│☽⃝┃ɐ⃞│
┝━╋━┿━╋━┿━╋━┿━╋━┥
7│☀⃟┃☀⃝│☀⃝┃☀⃝│☽⃝┃☽⃝│☽⃝┃☽⃟│
├─╂─┼─╂─┼─╂─┼─╂─┤
6│ ┃ │ ┃ │ ┃ │ ┃ │
┝━╋━┿━╋━┿━╋━┿━╋━┥
5│ ┃ │ ┃ │ ┃ │ ┃ │
├─╂─┼─╂─┼─╂─┼─╂─┤
4│ ┃ │ ┃ │ ┃ │ ┃ │
┝━╋━┿━╋━┿━╋━┿━╋━┥
3│ ┃ │ ┃ │ ┃ │ ┃ │
├─╂─┼─╂─┼─╂─┼─╂─┤
2│⸸⃟┃⸸⃝│⸸⃝┃⸸⃝│♛⃝┃♛⃝│♛⃝┃♛⃟│
┝━╋━┿━╋━┿━╋━┿━╋━┥
1│a⃞┃⸸⃝│⸸⃝┃⸸⃝│♛⃝┃♛⃝│♛⃝┃a⃞│
└─┸─┴─┸─┴─┸─┴─┸─┘
a b c d e f g h

---

Code
Expand Down Expand Up @@ -117,6 +141,30 @@

a b c d e

---

Code
cat_piece(piecepack_leapfrog(), annotate = TRUE)
Output
┌─┰─┬─┰─┬─┰─┐
8│☀⃝┃☀⃝│☀⃝┃☀⃝│☀⃝┃☀⃝│
┝━╋━┿━╋━┿━╋━┥
7│☽⃝┃☽⃝│☽⃝┃☽⃝│☽⃝┃☽⃝│
├─╂─┼─╂─┼─╂─┤
6│ ┃ │ ┃ │ ┃ │
┝━╋━┿━╋━┿━╋━┥
5│ ┃ │ ┃ │ ┃ │
├─╂─┼─╂─┼─╂─┤
4│ ┃ │ ┃ │ ┃ │
┝━╋━┿━╋━┿━╋━┥
3│ ┃ │ ┃ │ ┃ │
├─╂─┼─╂─┼─╂─┤
2│♛⃝┃♛⃝│♛⃝┃♛⃝│♛⃝┃♛⃝│
┝━╋━┿━╋━┿━╋━┥
1│⸸⃝┃⸸⃝│⸸⃝┃⸸⃝│⸸⃝┃⸸⃝│
└─┸─┴─┸─┴─┸─┘
a b c d e f

---

Code
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-checker_games_other.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ test_that("checker other games work as expected", {
expect_snapshot(cat_piece(checker_four_field_kono()))
expect_snapshot(cat_piece(checker_grasshopper()))
expect_snapshot(cat_piece(checker_julgonu()))
expect_snapshot(cat_piece(checker_kangaroo()))
expect_snapshot(cat_piece(checker_lines_of_action()))
})
4 changes: 2 additions & 2 deletions tests/testthat/test-games_info.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
test_that("*_games() row counts", {
expect_equal(nrow(alquerque_games()), 2L)
expect_equal(nrow(checker_games()), 32L)
expect_equal(nrow(checker_games()), 33L)
expect_equal(nrow(chess_games()), 5L)
expect_equal(nrow(domino_games()), 10L)
expect_equal(nrow(go_games()), 2L)
expect_equal(nrow(marble_games()), 0L)
expect_equal(nrow(morris_games()), 7L)
expect_equal(nrow(piecepack_games()), 111L)
expect_equal(nrow(piecepack_games()), 113L)
expect_equal(nrow(reversi_games()), 2L)
expect_equal(nrow(stackpack_games()), 10L)
expect_equal(nrow(tarot_games()), 0L)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-piecepack_games_other.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ test_that("piecepack other games work as expected", {
expect_snapshot(cat_piece(piecepack_breakthrough(), annotate = TRUE))
expect_snapshot(cat_piece(piecepack_change_change(seed = 37), annotate = TRUE))
expect_snapshot(cat_piece(piecepack_dao(), annotate = TRUE))
expect_snapshot(cat_piece(piecepack_kangaroo(), annotate = TRUE))
expect_snapshot(cat_piece(piecepack_kings_valley(), annotate = TRUE))
expect_snapshot(cat_piece(piecepack_leapfrog(), annotate = TRUE))
expect_snapshot(cat_piece(
piecepack_kings_valley(variant = "retrieve the king"),
annotate = TRUE
Expand Down
Loading