makePiece: make a piece

Description Usage Arguments Value Examples

View source: R/class.R

Description

make a piece

Usage

1

Arguments

type

a alphabetic character giving 'type' of piece. Case sensitive.

loc

a numeric vector of length 2, giving the location (row, column) of the upper left corner of the piece. Should be >= 1 and <= 9, or NA.

Value

an object of class 'slidepzl_piece', which is a list with following elements:

type

'type' of piece

loc

location of piece

Examples

1
2
3
# a piece of type 'A' is on the board,
# whose upper left corner is located at (1, 1)
makePiece('A', c(1,1))

shigono/rSlidePzl documentation built on Jan. 21, 2021, 8:01 a.m.