| Title: | Looney Pyramid Graphics |
|---|---|
| Description: | Functions and objects to make Looney Pyramids graphics. |
| Authors: | Trevor L. Davis [aut, cre] (ORCID: <https://orcid.org/0000-0001-6341-4639>) |
| Maintainer: | Trevor L. Davis <[email protected]> |
| License: | CC BY-SA 4.0 |
| Version: | 0.2.1 |
| Built: | 2026-05-14 21:28:29 UTC |
| Source: | https://github.com/piecepackr/piecenikr |
icehouse_games() contain information about the games
whose setups are provided by this package.
icehouse_games()icehouse_games()
A tibble::tibble() data frame with character columns "game", "methods", "comment", and "url"
for game name, setup function name(s), possible comment, and url for more information.
head(icehouse_games()) nrow(icehouse_games())head(icehouse_games()) nrow(icehouse_games())
icehouse_parser() provides a parser to be used with PPN movetext.
looney_pyramid_parser() is an alias.
icehouse_parser(movetext = character(), metadata = list(), ...) looney_pyramid_parser(movetext = character(), metadata = list(), ...)icehouse_parser(movetext = character(), metadata = list(), ...) looney_pyramid_parser(movetext = character(), metadata = list(), ...)
movetext |
A named character vector of move text. |
metadata |
A named list of metadata |
... |
Passed to |
A named list of data frames with parsed game states.
if (requireNamespace("ppn", quietly = TRUE)) { l <- ppn::read_ppn(system.file("ppn/martian-chess.ppn", package = "piecenikr"), parse = FALSE)[[1L]] game <- icehouse_parser(l$movetext, l$metadata) }if (requireNamespace("ppn", quietly = TRUE)) { l <- ppn::read_ppn(system.file("ppn/martian-chess.ppn", package = "piecenikr"), parse = FALSE)[[1L]] game <- icehouse_parser(l$movetext, l$metadata) }
icehouse_pyramids() generates a data frame of icehouse pyramids,
looney_pyramids() is an alias.
icehouse_none() generates a zero-row data frame.
icehouse_setup_by_name() generates a data frame from a given icehouse game name.
icehouse_pyramids( ..., side = "top", piece_side = paste0("pyramid_", side), suit = rep(1:5, each = 3L), rank = rep.int(1:3, 5L), x = as.double(rep.int(1:5, 3L)), y = as.double(rep(3:1, each = 5L)), angle = 0, length.out = NA_integer_ ) icehouse_none() icehouse_setup_by_name( name, ..., getter = function(x) get(x, envir = getNamespace("piecenikr")) )icehouse_pyramids( ..., side = "top", piece_side = paste0("pyramid_", side), suit = rep(1:5, each = 3L), rank = rep.int(1:3, 5L), x = as.double(rep.int(1:5, 3L)), y = as.double(rep(3:1, each = 5L)), angle = 0, length.out = NA_integer_ ) icehouse_none() icehouse_setup_by_name( name, ..., getter = function(x) get(x, envir = getNamespace("piecenikr")) )
... |
Should be left empty. |
side |
Normally either "top" (default) or "face". |
piece_side |
If |
suit |
Suit value (color) of board and pieces.
|
rank |
Number of pips on the icehouse pyramid. |
x, y
|
Cartesian coordinates (numeric vectors) |
angle |
Rotation of bit/board (numeric vector of degrees, counter-clockwise).
Will be coerced by |
length.out |
The number of pieces. Not needed if all the arguments are the same length (or of length one) and this length is the same as the number of desired pieces. |
name |
Game name. Will be normalized by |
getter |
Function with a single function name argument to use.
By default will just look for functions in this package but
a developer may want to consider |
tibble data frames of setups for 1 games playable with the Looney Pyramids game system.
Data frame output can usually be plotted with pmap_piece(df, default.units = "in").
icehouse_martian_chess(n_players = 2, seed = NULL)icehouse_martian_chess(n_players = 2, seed = NULL)
n_players |
Number of players |
seed |
Random seed |
Here are links for more information about the various other games:
| Game | URL |
| Martian Chess | https://www.looneylabs.com/rules/martian-chess |
A tibble::tibble() data frame with the following columns:
"piece_side"
"suit"
"rank"
"cfg" (optional, defaults to "piecepack")
"x"
"y"
"angle" (optional, defaults to 0).
This data frame is compatible with piecepackr::render_piece() and likely ppcli::cat_piece().
looney_pyramid_game_system() provides a basic configuration object
for drawing Looney Pyramids, icehouse_game_system() is an alias.
looney_pyramid_game_system(..., border = TRUE) icehouse_game_system(..., border = TRUE)looney_pyramid_game_system(..., border = TRUE) icehouse_game_system(..., border = TRUE)
... |
Should be empty. |
border |
If |
Looney Pyramids aka Icehouse pieces is a game system invented by Andrew Looney. See https://www.looneylabs.com/looney-pyramids.
Returns a list with an icehouse_pieces configuration for drawing Looney Pyramids.
looneyPyramidGrob provides a basic grob function for the sides Looney Pyramids.
looneyPyramidGrob(piece_side, suit, rank, cfg = pp_cfg())looneyPyramidGrob(piece_side, suit, rank, cfg = pp_cfg())
piece_side |
Piece side of the piece |
suit |
Suit of the piece |
rank |
Rank of the piece |
cfg |
Piecepackr configuration object |
These functions are Deprecated in this release of piecenikr, they will be marked as Defunct and removed in a future version.
df_martian_chess(n_players = 2, seed = NULL) looney_pyramids(..., border = TRUE)df_martian_chess(n_players = 2, seed = NULL) looney_pyramids(..., border = TRUE)
n_players |
Number of players |
seed |
Random seed |
... |
Should be empty. |
border |
If |