cubing/kpuzzle

cubing/kpuzzle is the part of cubing.js that lets you calculate transformations and patterns for puzzles using the KPuzzle definition format (based on ksolve).

KTransformation

A KTransformation contains information about how to move pieces around a puzzle.

import { cube3x3x3 } from "https://cdn.cubing.net/v0/js/cubing/puzzles";

const kpuzzle = await cube3x3x3.kpuzzle();
const suneTransformation =
  kpuzzle.algToTransformation("R U R' U R U2' R'");

console.log(suneTransformation.repetitionOrder());
6