This little command line tool aims to find the shortest path for a Knight to take through a series of moves.
It is written with TypeScript and tests are run with Jest and it runs as a script with NodeJS.
NodeJS, it was developed with version 10.
- Clone the repo.
- Run
npm i
to install the dependencies. - Run
npm run build
to transpile to typescript. - Run
npm t
to run the tests.
From the command line, move to the newly created dist folder with cd dist/
Then use node index.js
to run the script. Instructions are provided at runtime on how to interact.
You'll need a file containing ♞ move events, there is an example file in the root of this repo called exampleMoves.json
that you can use with the script or as a template.
Run the script with this file using:
node index.js -p ../exampleMoves.json
- Further unit test coverage of Event and collection of Moves classes.
- Better handling of event types in the MovesCalculator class.