From b90483bbf99ff9e772e7767257d607e05ef2301f Mon Sep 17 00:00:00 2001 From: "Trevor L. Davis" Date: Thu, 30 Apr 2026 23:32:21 -0700 Subject: [PATCH] feat: `go_connect6()` and `go_renju()` (#62) Co-Authored-By: Claude Sonnet 4.6 --- DESCRIPTION | 2 +- NAMESPACE | 2 + NEWS.md | 5 + R/go.R | 20 ++++ README.md | 13 ++- man/go_games_variant.Rd | 10 +- tests/testthat/_snaps/go.md | 160 +++++++++++++++++++++++-------- tests/testthat/test-games_info.R | 2 +- tests/testthat/test-go.R | 8 +- 9 files changed, 173 insertions(+), 49 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 19afd68..12a1a39 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: ppdf Type: Package Title: Board Game Setups -Version: 0.3.0-19 +Version: 0.3.0-20 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 adfcbc7..281ceb9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -141,10 +141,12 @@ export(games_piecepack) export(games_stackpack) export(go_bits) export(go_board) +export(go_connect6) export(go_games) export(go_go) export(go_gomoku) export(go_none) +export(go_renju) export(go_setup_by_name) export(go_suit) export(marble_bits) diff --git a/NEWS.md b/NEWS.md index de13c0f..09ae7ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -29,6 +29,11 @@ New features + `domino_freecell()` + `domino_the_sultan()` +* The following functions generate data frames to setup go sets (#62): + + + `go_connect6()` + + `go_renju()` + * The following functions generate data frames to setup piecepack sets (#23, #35, #40, #49, #50): + `piecepack_achi()` diff --git a/R/go.R b/R/go.R index 3220af9..e5f75e2 100644 --- a/R/go.R +++ b/R/go.R @@ -101,6 +101,10 @@ go_games_variant <- function() { , ~methods , ~comment , ~url + , "Connect6" + , "``go_connect6()``" + , NA_character_ + , "https://en.wikipedia.org/wiki/Connect6" , "Go" , "``go_go()``" , NA_character_ @@ -109,6 +113,10 @@ go_games_variant <- function() { , "``go_gomoku()``" , NA_character_ , "https://en.wikipedia.org/wiki/Gomoku" + , "Renju" + , "``go_renju()``" + , NA_character_ + , "https://en.wikipedia.org/wiki/Renju" ) } @@ -116,6 +124,12 @@ go_games_variant <- function() { #' @param nrows Number of rows (lines) in game board #' @param ncols Number of columns (lines) in game board #' @export +go_connect6 <- function(nrows = 19L, ncols = nrows) { + go_board(nrows, ncols) +} + +#' @rdname go_games_variant +#' @export go_go <- function(nrows = 19L, ncols = nrows) { go_board(nrows, ncols) } @@ -125,3 +139,9 @@ go_go <- function(nrows = 19L, ncols = nrows) { go_gomoku <- function(nrows = 15L, ncols = nrows) { go_board(nrows, ncols) } + +#' @rdname go_games_variant +#' @export +go_renju <- function(nrows = 15L, ncols = nrows) { + go_board(nrows, ncols) +} diff --git a/README.md b/README.md index 2ee06eb..45729e3 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ animate_game(game, file = "man/figures/README-relativity.gif", ### Checkers Sets -`{ppdf}` supports the following 33 games playable with a (possibly non-8x8) checkers set: +`{ppdf}` supports the following 34 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) @@ -190,6 +190,7 @@ animate_game(game, file = "man/figures/README-relativity.gif", * [International Checkers AKA International Draughts](https://en.wikipedia.org/wiki/International_draughts) * [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/) +* [Jeson Mor](https://en.wikipedia.org/wiki/Jeson_Mor) * [Jul-Gonu](https://en.wikipedia.org/wiki/Jul-Gonu) * [Kangaroo](https://boardgamegeek.com/boardgame/6132/kangaroo-the-jumping-game) * [Lasca](http://www.lasca.org) @@ -206,11 +207,12 @@ animate_game(game, file = "man/figures/README-relativity.gif", ### Chess Sets -`{ppdf}` supports the following 5 games playable with a (possibly non-8x8) chess set: +`{ppdf}` supports the following 6 games playable with a (possibly non-8x8) chess set: * [Fischer Random Chess AKA Chess960](https://www.chessvariants.com/diffsetup.dir/fischer.html) * [Horde Chess](https://lichess.org/variant/horde) * [(International) Chess](https://en.wikipedia.org/wiki/Chess) +* [Jeson Mor](https://en.wikipedia.org/wiki/Jeson_Mor) * [Monochrome Chess](https://wunderland.com/WTS/Andy/Games/monochess.html) * [Racing Kings](https://www.chessvariants.com/diffobjective.dir/racing.html) @@ -231,7 +233,7 @@ animate_game(game, file = "man/figures/README-relativity.gif", ### Piecepacks -`{ppdf}` supports the following 114 games playable with a piecepack deck (plus possibly additional components): +`{ppdf}` supports the following 115 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)) @@ -286,6 +288,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/) * [Japan](https://www.ludism.org/ppwiki/Japan) +* [Jeson Mor](https://en.wikipedia.org/wiki/Jeson_Mor) * [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) @@ -355,10 +358,12 @@ animate_game(game, file = "man/figures/README-relativity.gif", * [Alquerque](https://en.wikipedia.org/wiki/Alquerque) * [Bagh-chal](https://en.wikipedia.org/wiki/Bagh-chal) -`{ppdf}` supports the following 2 games playable with a go set +`{ppdf}` supports the following 4 games playable with a go set +* [Connect6](https://en.wikipedia.org/wiki/Connect6) * [Go](https://en.wikipedia.org/wiki/Go_(game)) * [Gomoku](https://en.wikipedia.org/wiki/Gomoku) +* [Renju](https://en.wikipedia.org/wiki/Renju) `{ppdf}` supports the following 7 games playable with a morris set diff --git a/man/go_games_variant.Rd b/man/go_games_variant.Rd index 9a9c5ba..7d92523 100644 --- a/man/go_games_variant.Rd +++ b/man/go_games_variant.Rd @@ -2,13 +2,19 @@ % Please edit documentation in R/go.R \name{go_games_variant} \alias{go_games_variant} +\alias{go_connect6} \alias{go_go} \alias{go_gomoku} +\alias{go_renju} \title{Setups for go variants} \usage{ +go_connect6(nrows = 19L, ncols = nrows) + go_go(nrows = 19L, ncols = nrows) go_gomoku(nrows = 15L, ncols = nrows) + +go_renju(nrows = 15L, ncols = nrows) } \arguments{ \item{nrows}{Number of rows (lines) in game board} @@ -30,14 +36,16 @@ 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 2 go variants. +\code{tibble} data frames of setups for 4 go variants. Data frame output can usually be plotted with \code{pmap_piece(df, default.units = "in")}. } \details{ Here are links for more information about the various games:\tabular{ll}{ \strong{Game} \tab \strong{URL} \cr + Connect6 \tab \url{https://en.wikipedia.org/wiki/Connect6} \cr Go \tab \url{https://en.wikipedia.org/wiki/Go_(game)} \cr Gomoku \tab \url{https://en.wikipedia.org/wiki/Gomoku} \cr + Renju \tab \url{https://en.wikipedia.org/wiki/Renju} \cr } } \examples{ diff --git a/tests/testthat/_snaps/go.md b/tests/testthat/_snaps/go.md index bf2c590..8c46757 100644 --- a/tests/testthat/_snaps/go.md +++ b/tests/testthat/_snaps/go.md @@ -1,92 +1,174 @@ # go games work as expected Code - cat_piece(go_bits()) + cat_piece(go_bits(), annotate = TRUE) Output - ● ● ● ● ● ○ - + 1 ● ● ● ● ● ○ + a b c d e f --- Code - cat_piece(go_go()) + cat_piece(go_connect6(), annotate = TRUE) Output - ┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ + 19┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 18┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 17┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 16┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 15┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 14┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 13┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 12┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 11┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 10┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 9 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 8 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 7 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 6 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 5 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 4 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 3 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 2 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + 1 └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + a b c d e f g h i j k l m n o p q r s + +--- + + Code + cat_piece(go_go(), annotate = TRUE) + Output + 19┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 18┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 17┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 16┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 15┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 14┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 13┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 12┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 11┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 10┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 9 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 8 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 7 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 6 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 5 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 4 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 3 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 2 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 1 └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + a b c d e f g h i j k l m n o p q r s --- Code - cat_piece(go_gomoku()) + cat_piece(go_gomoku(), annotate = TRUE) Output - ┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ + 15┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 14┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 13┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 12┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 11┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 10┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 9 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 8 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 7 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 6 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 5 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 4 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 3 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + 2 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ - └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + 1 └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + a b c d e f g h i j k l m n o + +--- + + Code + cat_piece(go_renju(), annotate = TRUE) + Output + 15┌─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┰─┐ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 14┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 13┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 12┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 11┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 10┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 9 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 8 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 7 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 6 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 5 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 4 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 3 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 2 ┝━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━╋━┥ + │ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ │ + 1 └─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┸─┘ + a b c d e f g h i j k l m n o diff --git a/tests/testthat/test-games_info.R b/tests/testthat/test-games_info.R index 95ad7ea..16b056b 100644 --- a/tests/testthat/test-games_info.R +++ b/tests/testthat/test-games_info.R @@ -3,7 +3,7 @@ test_that("*_games() row counts", { expect_equal(nrow(checker_games()), 34L) expect_equal(nrow(chess_games()), 6L) expect_equal(nrow(domino_games()), 10L) - expect_equal(nrow(go_games()), 2L) + expect_equal(nrow(go_games()), 4L) expect_equal(nrow(marble_games()), 0L) expect_equal(nrow(morris_games()), 7L) expect_equal(nrow(piecepack_games()), 115L) diff --git a/tests/testthat/test-go.R b/tests/testthat/test-go.R index a269ab0..f54b3b8 100644 --- a/tests/testthat/test-go.R +++ b/tests/testthat/test-go.R @@ -2,7 +2,9 @@ test_that("go games work as expected", { skip_if_not_installed("ppcli", "0.2.0-1") skip_on_os("windows") - expect_snapshot(cat_piece(go_bits())) - expect_snapshot(cat_piece(go_go())) - expect_snapshot(cat_piece(go_gomoku())) + expect_snapshot(cat_piece(go_bits(), annotate = TRUE)) + expect_snapshot(cat_piece(go_connect6(), annotate = TRUE)) + expect_snapshot(cat_piece(go_go(), annotate = TRUE)) + expect_snapshot(cat_piece(go_gomoku(), annotate = TRUE)) + expect_snapshot(cat_piece(go_renju(), annotate = TRUE)) })