JSPM

cubing

0.9.17
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 557
  • Score
    100M100P100Q107100F
  • License GPL-3.0-or-later

Meta-library containing multiple js.cubing.net projects.

Package Exports

  • cubing/alg
  • cubing/kpuzzle
  • cubing/puzzle-geometry
  • cubing/twisty

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 (cubing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cubing.js

A meta-library that makes it easy to use multiple js.cubing.net libraries.

Usage

Browser

<script src="cubing.js"></script>
<script>
  const sune = alg.parse("R U R' U R U2 R'");
  const antiSune = alg.invert(sune);
  console.log(alg.algToString(antiSune));

  const {KPuzzle, Puzzles} = kpuzzle;

  const puzzle = new KPuzzle(Puzzles["333"]);
  puzzle.applyMove("R");
  console.log(puzzle.state);
</script>

Node / TypeScript

import {parse, invert, algToString} from "cubing/alg"
import {KPuzzle, Puzzles} from "cubing/kpuzzle"

const sune = parse("R U R' U R U2 R'");
const antiSune = invert(sune);
console.log(algToString(antiSune));

const puzzle = new KPuzzle(Puzzles["333"]);
puzzle.applyMove("R");
console.log(puzzle.state);