icehouse_pyramids: Generate icehouse pieces

View source: R/icehouse_pieces.R

icehouse_pyramidsR Documentation

Generate icehouse pieces

Description

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.

Usage

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"))
)

Arguments

...

Should be left empty.

side

Normally either "top" (default) or "face".

piece_side

If "board_face" a checkered board (as in American Checkers). If "board_back" a lined board (as in Turkish Checkers).

suit

Suit value (color) of board and pieces. 1L is "red", 2L is "black", 3L is "green", 4L is "blue", 5L is "yellow", and 6L is "white". Will be coerced by piece_suit().

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 piece_angle().

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 normalize_name().

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 dynGet() or a wrapper around get() with a custom envir argument.


piecepackr/piecenikr documentation built on June 12, 2025, 5:33 p.m.