cube-scramble.js
v1.0.18
Published
Unofficial scrambler for WCA puzzles cubes using Vanilla JS
Downloads
21
Maintainers
Readme
🧩 CubeScrambler
Unofficial scrambler for WCA puzzles cubes using Vanilla JS
Usage
To see all of the scramble types available, use scrambleList
const scrambler = require('cube-scramble.js');
const types = scrambler.scrambleList; // returns an array
To generate a scramble, use the scramble
function
const scrambler = require('cube-scramble.js');
const type = 'pyraminx';
const sequence = scramblers.scramble(type); // returns an array
You can also use import
statements in a variety of ways:
Import the scramble function
import { scramble } from 'cube-scramble.js';
const type = '3x3';
const sequence = scramble(type);
console.log(sequence);
Import the scrambleList property
import { scrambleList as types } from 'cube-scramble.js';
console.log(types);
You can also import specific scramble types. Note that this currently doesn't work for NxN cubes.
import { pyraminx } from 'cube-scramble.js';
const sequence = pyraminx();
console.log(sequence);
If an invalid type is used, you will see the following message: Error: Invalid scramble type provided.