The 15-puzzle is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. Game is represented by 4x4 tiles board where 15 numbered tiles are initially placed in random order and where 16th tile is missing. A tile can be moved to a neighbour empty place. To succeed in the game you need to order tiles from 1 to 15, where tile number 1 is at the top left corner and empty one is at the bottom right corner.
-- Wikipedia
The stack is built using parcel so to get started all you have to do is:
# install dependencies
> npm install
# serve with hot reload at localhost:1234
> npm run dev
Other commands available are:
# build for production with minification (check `/dist` folder)
npm run build
# run unit tests
npm run test
# run unit in watch mode
npm run test:watch
# run unit in coverage mode
npm run test:cov
# check code style
npm run lint
# check code style and fix potentially fixable issues
npm run lint:fix
Roadmap:
- Implement 15-puzzle (naive shuffling algorithm)
- Host on netlify
- Improve look & feel
- Animations for swapping tiles
- Use proper algorithm for shuffling (e.g. with A* algorithm to ensure solvability)
- Introduce levels of difficulty