rubiks-cross-trainer
v1.0.6
Published
A JavaScript library that gives you Rubiks cube scrambles to practice forming your cross.
Downloads
21
Maintainers
Readme
Getting started
npm install --save rubiks-cross-trainer
Why?
Forming the cross on your Rubik's Cube is the first step in CFOP. It should never take more than 8 moves to form your cross, and this library gives you a chance to practice at your own comfort.
API
import getRandomSolve from "rubiks-cross-trainer";
const scramble = getRandomSolve(1);
console.log(scramble);
// "F2 D' F2 U2 L' U' R2 F' R2 D' B' R2 U2 B U2 B' L2 D2 B U2 B"
// Returns a scramble that requires 1 move to form the cross
const anotherScramble = getRandomSolve(8);
console.log(anotherScramble);
// "B D2 U2 F' D2 F2 D2 R2 D2 B' F' D B L' D F R B U' R2"
// Returns a scramble that requires 8 moves to form the cross
const moreThanEightMoves = getRandomSolve(100);
console.log(moreThanEightMoves);
// undefined
// Returns undefined for ranges outside of 1-8
Inspiration
This JavaScript library was inspired by this Reddit thread.