This repository contains an implementation of a Knight's Travails problem in chess. The code finds a shortest path that a knight can take on a chessboard to move from a given starting position to a target position, visiting each square only once.
The code consists of the following files:
index.js
: Contains an example usage of theknightsMoves
function.knights.js
: Contains the main functionknightsMoves
that solves the Knight's Travails problem.
To use the code, follow these steps:
- Ensure you have Node.js installed on your system.
- Clone this repository to your local machine.
- Open a terminal and navigate to the project directory.
- Run the following command to execute the code:
node index.js