Learn R Programming

cubing (version 1.0-5)

read.cubesolve: 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.

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.

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.

See Also

getMovesCube, invMoves, is.solved, move

Examples

Run this code
# NOT RUN {
cho <- read.cubesolve(4995)
# }
# NOT RUN {
aCube <- getMovesCube(cho$scramble)
# }
# NOT RUN {
mv <- cho$solution
# }
# NOT RUN {
is.solved(move(aCube, mv))
# }

Run the code above in your browser using DataLab