read.cubesolve {cubing}R Documentation

Read Cube Solving Reconstructions

Description

Reads cube solving scrambles and solutions for the cube solves website.

Usage

read.cubesolve(n, warn = FALSE)

Arguments

n

A single integer n giving the id for the solve.

warn

If FALSE, an error is returned when the id does not exist. If TRUE, a warning is given.

Details

The function reads from the html source of the www.cubesolv.es website, and may fail if the website subsequently changes.

Round brackets immediately followed by any single digit are expanded upon reading, for example (R U)4 becomes R U R U R U R U. All other round brackets are removed. Commutator and conjugate notation is not implemented, so square brackets cannot be used and a warning is given if they are found.

The website does not have automated checking and therefore a typographic error may lead to non-valid moves (or cubes that do not solve). This most commonly occurs when the space between two valid moves is accidentally omitted.

Value

A list containing the scramble, solution and description. The scramble and solution items are character vectors of moves. The description is a character string. If the scramble or solution (or both) is missing, then length zero vectors are returned for these items.

See Also

getMovesCube, invMoves, is.solved, move

Examples

## Not run: cho <- read.cubesolve(4995)
## Not run: aCube <- getMovesCube(cho$scramble)
## Not run: mv <- cho$solution
## Not run: is.solved(move(aCube, mv))

[Package cubing version 1.0-5 Index]