https://github.com/hattima-tim/knight-travails
A visual representation of the knight's optimal movement.
https://github.com/hattima-tim/knight-travails
algorithms-and-data-structures breadth-first-search chess graph
Last synced: 9 months ago
JSON representation
A visual representation of the knight's optimal movement.
- Host: GitHub
- URL: https://github.com/hattima-tim/knight-travails
- Owner: hattima-tim
- Created: 2022-11-24T15:00:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-30T12:24:27.000Z (almost 3 years ago)
- Last Synced: 2025-01-18T13:48:27.524Z (10 months ago)
- Topics: algorithms-and-data-structures, breadth-first-search, chess, graph
- Language: JavaScript
- Homepage: https://hattima-tim.github.io/knight-travails/
- Size: 328 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# knight-travails
This project is a visual representation of a [problem](https://www.theodinproject.com/lessons/javascript-knights-travails) I had to solve as part of [The Odin Project](https://github.com/TheOdinProject). The problem was to write a program that will find the shortest path a knight can take, to move between two positions on a chessboard.
https://user-images.githubusercontent.com/29122213/204795217-092199b9-e27a-41a0-bb32-ba96451cfed9.mp4
See the project live [here](https://hattima-tim.github.io/knight-travails/).
## A bit about the path finding program
The program uses graph data structure and breadth-first-search algorithm for finding the shortest path.
## Challenges
- The first challenge I faced when solving the path finding problem, is the graph data structure. I did not know what it is and how it works. So, I had to learn about this.
- After that, I had to choose between depth-first-search and breadth-first-search for graph traversal. This was the hardest part. After trying to implement both and spending a lot of time, I decided to focus on just breadth-first-search and was able to solve the problem with it.