0.1.2 • Published 7 years ago
scramble-parser v0.1.2
scramble-parser
npm install scramble-parser
API
parseScramble
Takes a given string and parses it into a scramble of Move objects.
Parameters
scrambleString
string The string to be parsed as a scramble.
Examples
import parseScramble from 'scramble-parser';
parse("R' U F D2");
// [ { face: 'R', inverted: true, double: false },
// { face: 'U', inverted: false, double: false },
// { face: 'F', inverted: false, double: false },
// { face: 'D', inverted: false, double: true } ]
parse("R J Q D2 F U'"); // null
Returns (Array<Move> | null) An array of Move objects representing the given scramble, or null if the scramble isn't valid.