- This package contains functions that return
{tibble}
data frames with (possibly random) setup data for over a hundred board games playable with public domain game systems. - This board game data can be visualized by {piecepackr} using the
{grid}
,{ggplot2}
,{rayrender}
,{rayvertex}
, or{rgl}
graphics systems or in a command-line interface using{cli}
byppcli::cat_piece()
. - If you use Portable Piecepack Notation (PPN) to record the moves for any of games supported by this package then you can visualize any/all of the moves for that game with the help of the PPN parser in {ppn}.
- The package name "ppdf" is an acronym for piecepackr data frames".
- Many of these functions were originally contained (under a slightly different name) in the experimental {ppgames} and {tradgames} packages.
remotes::install_github("piecepackr/ppdf")
df_fujisan <- ppdf::domino_fujisan(seed = 42)
if (requireNamespace("piecepackr", quietly = TRUE) &&
all(capabilities("png"))) {
library("piecepackr")
envir <- game_systems(pawn = "joystick", round = TRUE)
render_piece(df_fujisan, file = "man/figures/README-fujisan.png",
envir = envir, op_scale = 0.5, op_angle = 90,
trans = op_transform, as_top = "pawn_face")
}
df_loa <- ppdf::checkers_lines_of_action()
if (requireNamespace("piecepackr", quietly = TRUE) &&
all(capabilities("png"))) {
library("piecepackr")
envir <- game_systems()
render_piece(df_loa, file = "man/figures/README-lines-of-action.png",
envir = envir, op_scale = 0.5, trans = op_transform)
}
df_tablut <- ppdf::piecepack_tablut()
if (requireNamespace("piecepackr", quietly = TRUE) &&
requireNamespace("systemfonts", quietly = TRUE) &&
piecepackr::has_font("Dejavu Sans") &&
all(capabilities(c("cairo", "png")))) {
library("piecepackr")
envir <- game_systems("dejavu", pawn = "joystick")
render_piece(df_tablut, file = "man/figures/README-tablut.png",
envir = envir, op_scale = 0.5,
trans = op_transform, as_top = "pawn_face")
}
An example game of Relativity recorded in the Portable Piecepack Notation (PPN) format:
ppn_file <- system.file("ppn/relativity.ppn", package = "ppn")
cat(paste("\t", readLines(ppn_file)), sep = "\n")
---
Round: Night
GameType:
Name: Relativity
Coins: "n45a5n/3a2243/3n4a2n/a25345"
...
{ Notes: Space has power of adjacency while Time has power of sequence }
1S. d3#e3 1T. d3#d1
2S. c2#c3 2T. d2#b1;M2@e6
3S. b2#a2 3T. e3#b2
4S. f1#f4 4T. e2#a3;M3@e6
5S. c4#d4 5T. f1#a1
6S. c1#c4;M5@b6 6T. b3#a3
7S. f3#a3 7T. d1#a3
8S. f2#f3 8T. b1#d2
9S. f3#a3;Mn@b6 9T. e2#c2
10S. e1#f1 10T. f1#d4
11S. c2#c3 11T. d4#c4
12S. b2#c2 12T. c1#e2;Ma@e6
Since Relativity is one of the games supported by this package (i.e. the function piecepack_relativity()
) then ppn::read_ppn()
can be used to parse this PPN file and then ppn::animate_game()
can be used to animate the parsed game:
library("gifski")
library("piecepackr")
library("ppn") # remotes::install_github("piecepackr/ppn")
library("tweenr")
envir <- game_systems("dejavu")
cfg <- as.list(envir$piecepack)
cfg$suit_color <- "black"
cfg$background_color.r1 <- "#E69F00"
cfg$background_color.r2 <- "#56B4E9"
cfg$background_color.r3 <- "#009E73"
cfg$background_color.r4 <- "#F0E442"
cfg$background_color.r5 <- "#D55E00"
cfg$background_color.r6 <- "#F079A7"
envir$piecepack <- pp_cfg(cfg)
ppn_file <- system.file("ppn/relativity.ppn", package = "ppn")
game <- read_ppn(ppn_file)[[1]]
animate_game(game, file = "man/figures/README-relativity.gif",
annotate = FALSE,
envir = envir, trans = op_transform, op_scale = 0.5,
n_transitions = 3, n_pauses = 2, fps = 7)
{ppdf}
supports the following 24 games playable with a (possibly non-8x8) checkers set:
- (American) Checkers AKA (English) Draughts
- American Pool Checkers
- Brazilian Checkers AKA Brazilian Draughts
- Breakthrough
- Canadian Checkers AKA Canadian Draughts
- Crossings
- Czech Checkers AKA Czech Draughts
- Dameo
- Dao
- Focus
- Four Field Kono
- Frisian Checkers AKA Frisian Draughts
- Gothic Checkers AKA Gothic Draughts
- Grasshopper
- International Checkers AKA International Draughts
- Italian Checkers AKA Italian Draughts
- Jamaican Checkers AKA Jamaican Draughts
- Jul-Gonu
- Lines of Action
- Portuguese Checkers AKA Portuguese Draughts
- Russian Checkers AKA Russian Draughts
- Spanish Checkers AKA Spanish Draughts
- Thai Checkers AKA Thai Draughts AKA Mak-hot AKA Makhos
- Turkish Checkers AKA Turkish Draughts AKA Dama
{ppdf}
supports the following 5 games playable with a (possibly non-8x8) chess set:
{ppdf}
supports the following 7 games playable with a (usually double-6) dominoes set (plus possibly additional components):
{ppdf}
supports the following 95 games playable with a piecepack deck (plus possibly additional components):
- 12345ive!
- Alice Chess
- Alien City
- Alquerque AKA Qirkat
- (American) Checkers AKA (English) Draughts
- American Pool Checkers
- Awithlaknannai Mosona
- Backgammon
- Black Pawn Trucking
- Brain Burn
- Brandubh AKA Brandub
- Brazilian Checkers AKA Brazilian Draughts
- Breakthrough
- Burbuja
- Cardinal's Guards
- Cell Management
- Change Change
- Chariots
- Chaturaji
- Chinese Checkers AKA (Piecepack) Halma
- Climbing Man
- Coin Collectors
- Cribbage
- Crocodile Hop
- Crossings
- Czech Checkers AKA Czech Draughts
- Dao
- Desfases
- Dominoids
- Easy Slider
- Evade
- Everest
- Fischer Random Chess AKA Chess960
- Four Blind Mice
- Four Field Kono
- Four Seasons Chess
- Froggy Bottom
- Fuji-san
- Galaxy Express
- Gothic Checkers AKA Gothic Draughts
- Grasshopper
- Ice Floe
- Iceberg
- (International) Chess
- Italian Checkers AKA Italian Draughts
- Jamaican Checkers AKA Jamaican Draughts
- Japan
- Jul-Gonu
- Lab Rats
- Landlocked
- Ley Lines
- Lines of Action
- Ludo
- Lukawan
- Mathrix
- Minishogi
- Nine Men's Morris
- One Man Thrag!
- Pass the Food
- Pawns Crossing
- Piece Gaps
- Piece Packing Pirates
- (Piecepack) Klondike
- Piecepackman
- Plans of Action
- Portuguese Checkers AKA Portuguese Draughts
- Quatri
- Racing Kings
- Relativity
- Russian Checkers AKA Russian Draughts
- Salta
- San Andreas
- Sarcophagus
- Ship It!
- Shogi AKA Japanese Chess
- Shopping Mall
- Skyscrapers
- Slides of Action
- Spanish Checkers AKA Spanish Draughts
- Speedy Towers
- Steppin' Stones
- Tablut
- Thai Checkers AKA Thai Draughts AKA Mak-hot AKA Makhos
- The "In" Crowd
- The Magic Bag
- The Penguin Game
- Tower of Babel AKA (Piecepack) Accordion
- Tracers
- Triactor
- Tula
- Turkish Checkers AKA Turkish Draughts AKA Dama
- Twelve Men's Morris
- Ultima AKA Baroque Chess
- Wormholes
- Xiangqi AKA Chinese Chess
{ppdf}
supports the following 1 games playable with an alquerque set
- {piecepackr} can be used visualize game setups generated by
{ppdf}
with{grid}
,{ggplot2}
,{rayrender}
,{rayvertex}
, or{rgl}
graphics systems. - {ppcli} can be used to visualize game setups generated by
{ppdf}
in the terminal with{cli}
. - {ppn} contains a Portable Piecepack Notation (PPN) parser that handles all the games supported by this package (and more)
- {piecenikr} has Looney Pyramids aka Icehouse pieces support.
- splendid-r-games for list of games you can play in the R language