Skip to contents

These functions help make sure angle values are the right double values expected by the configurations used by piecepackr::game_systems() and ppn::read_ppn(). If the input is numeric it simply uses as.double() and if the input is character it tries to cast to a reasonable value.

Usage

piece_angle(angle)

Arguments

angle

A numeric or character vector of angle values.

Value

An double vector of angle values.

Examples

piece_angle(c("^", "<", "v", ">"))
#> [1]   0  90 180 270
piece_angle(c("\U0001f06e", "\U0001f038"))
#> [1]   0 270