JSPM

sr-scrambler

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q41907F
  • License ISC

utilitiy to generate scrambles for twisty puzzles

Package Exports

  • sr-scrambler

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sr-scrambler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

srScrambler

Javascript class to generate scrambles for any size nxn Rubik's cube. Scrambles can be generated to display on html pages. The scrambler efficiently generates sequences. For example F and F' will not appear next to eachother in scramble. This script was made to power the cube scrambler for http://www.solvingrubik.com/timer

Instalation

Install the package using npm

bower install --save sr-scrambler

Usage

Import the module

import * as SRScrambler from 'sr-scrambler'

Generate a scramble by calling the generateScramble method, passing in the number of layers in the cube and the number of turns you want in the scramble. This returns an array of turns which may or may not be helpful to you.

var scramble = SRScrambler.generateScramble(3, 30);

HTML friendly scrambles can also be generated so the scramble can be displayed on a web page.

var scramble = SRScrambler.generateHtmlScramble(3, 30);