Skip to content

tdecker91/puzzle-gen

Repository files navigation

PuzzleGen

PuzzleGen is a javascript library intended to render WCA puzzles. Colors can be customized, or scrambles can be applied to make references for solve guides or scramble previews. It's heavily inspired by visualcube and twistysim. My first go at this was porting visuacube to javascript here. But in order to get all the functionality desired, I had to completely rewrite from scratch.

PuzzleGen is built to be customizable, so if desired functionality can be extended to use cases other than embedding scramble previews in web pages.

Demonstration

Check out the library in action HERE

Docs

See the docs for more information

Examples

Here are some examples of what the library is capable of.

Installation

> npm install sr-puzzlegen

Usage

For full usage demonsration see here

Development

Requirements

  • Node.js - v16.14.0 but other versions may work

Tools Used

Install dependencies

> npm install

Run development demos. This will automatically start a web server and open a browser to the index. For more info see Demos

> npm run dev

Run tests cases (Yes we have some tests!)

> npm t

Build library. This will save build assets to dist/

> npm run build # build the bundled library with webpack to /dist/bundle
> tsc # build unbundled library to /dist/lib

Publish to registry

  1. update version in package.json
  2. build bundle npm run build and build library tsc
  3. run npm publish command
> npm publish