Skip to contents

reversi_board() returns various reversi boards. reversi_bits() returns reversi pieces.

Usage

reversi_board(
  nrows = 8L,
  ncols = nrows,
  x0 = 1,
  y0 = 1,
  ...,
  side = "face",
  piece_side = paste0("board_", side),
  suit = "black",
  angle = 0
)

reversi_bits(
  ...,
  side = "face",
  piece_side = paste0("bit_", side),
  suit = 1:6,
  x = as.double(1:6),
  y = 1,
  angle = 0,
  length.out = NA_integer_
)

Arguments

nrows

Number of rows in game board

ncols

Number of columns in game board

x0

X coordinate for the center of the first point

y0

Y coordinate for the center of the first point

...

Should be left empty.

side

Either "face" or "back"

piece_side

If "board_face" a lined board. If "board_back" a checkered board.

suit

Suit value (color) of board/bit. 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().

angle

Angle of board in degrees.

x, y

Cartesian coordinates (numeric vectors)

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.

Value

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