0.1.6 • Published 6 years ago

solution-analyzer v0.1.6

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Solution Analyzer GitHub license npm version Build Status Coverage Status Try it on RunKit

A library for analyzing Rubik's Cube solutions.

Installation

npm install --save solution-analyzer

Usage

With Node

const solutionAnalyzer = require('solution-analyzer');

solutionAnalyzer.analyzeSolution(...);

With ES6

import { analyzeSolution } from 'solution-analyzer';

analyzeSolution(...);

API

analyzeSolution(scramble, solution, method)
ArgumentTypeDescription
scramblestringscrambling moves sequence
solutionstringfull or partial solution moves sequence
methodstringa speedsolving method name, either of: CFOP, Roux, ZZ.

Returns an object representing the solution. Example: Try it on RunKit

analyzeSolution(
  "B2 L2 D' R2 D' L2 R2 D2 B2 D' R' F2 D R F D' R D' B' L",
  "z2 L2 F' D' U R' U2 R' U R' F R2 F' R U' R' y2 U R U R' U2 y R' D' F D R U f R U R' U' f' U' B' R2 D' R U' R' D R2 U B U'",
  'CFOP'
);
// =>
{
  solved: true,
  steps: [
    {
      label: 'inspection',
      moves: ["z2"]
    }, {
      label: 'cross',
      moves: ["L2", "F'", "D'", "U", "R'"]
    }, {
      label: '1st pair',
      moves: ["U2", "R'", "U", "R'", "F", "R2", "F'"]
    }, {
      label: '2nd pair',
      moves: [ "R", "U'", "R'"]
    }, {
      label: '3rd + 4th pair',
      moves: ["y2", "U", "R", "U", "R'", "U2", "y", "R'", "D'", "F", "D", "R"]
    }, {
      label: '1LLL',
      moves: ["U", "f", "R", "U", "R'", "U'", "f'", "U'", "B'", "R2", "D'", "R", "U'", "R'", "D", "R2", "U", "B"]
    }, {
      label: 'AUF',
      moves: ["U'"]
    }
  ]
}
0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago