Socket
Socket
Sign inDemoInstall

solution-analyzer

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    solution-analyzer

A library for analyzing Rubik's Cube solutions.


Version published
Weekly downloads
5
increased by150%
Maintainers
1
Install size
47.6 kB
Created
Weekly downloads
 

Readme

Source

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'"]
    }
  ]
}

Keywords

FAQs

Last updated on 24 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc