A virtual Rubik's cube made with JavaScript.

Usage no npm install needed!

<script type="module">
  import faztasioRubikscube from 'https://cdn.skypack.dev/@faztasio/rubikscube';


Rubik's Cube

A Rubik's Cube simulator written in TypeScript (Node.js) for the terminal.

npm i --save @faztasio/rubikscube

A quick preview of the simulator.

const cubelib = require('rubikscube');

const cube = cubelib.createCube();
cubelib.exec(cube, 'R2 L2 F2 B2 D2 U2');

Currently only supports the 3x3 Rubik's Cube. Support for larger and smaller cubes may or may not be added in the future.



// TypeScript
import * as cubelib from 'rubikscube';
// Plain JavaScript
const cubelib = require('rubikscube');

Create a Cube

const mainCube = cubelib.createCube();

Execute an Algorithm

cubelib.exec(mainCube, `R U R' U'`);

Render to Terminal