/knights-tour

Simple Vanilla JS Project to demonstrate Knight's Tour Solution Strategies

Primary LanguageJavaScript

Knight's Tour Solver

Simple Vanilla JS app developed to show Knight's Tour problem solving process.

ezgif-4-c8790b59ea

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed (or re-entrant); otherwise, it is open.Trying to find such sequence only by brute force is not a good idea, for example, there are approximately 4×10^51 possible move sequences on an 8 × 8 board.

In my project we can choose one or more strategies to search for a knight's tour solution and graphically see the process, what is a cool feature in exchange for some performance. Of course the project was built just for didactic purposes and do not intent to be more performant than the necessary.



Run the project




Made with ❤️ by kortkamp