Skip to content

jniemann66/knightsTour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knights Tours

A tool for exploring the world of Knights tours on arbitrary board sizes

Live Demo

Knight's Tours

Description

This app calculates Knight's Tours on chess boards of arbitrary size up to 26 x 26 squares. After a knight's tour has been calculated, the user can step through the Knight's path. Visited squares are darkened to indicate that they are no longer available to be visited again.

The starting square can be selected by simply clicking on a square.

Additionally, the interface is responsive (by virtue of Bootstrap), and should work on small screens as well as large.

This project in written in React and uses the react-chessdiagram react component.

The Knights tours are calculated using Warnsdorf's rule with the added "furthest from center" heuristic emplyed as a tie-breaker.

Building this app

Clone this repository and issue an npm install command at the root of the folder, and then issue an npm start command to start

To-do

  • Implement the (auto) play button (ie automatically step through the sequence when play button is presesed)

  • Adjustable speed for auto-play (it's fast, which is good for large boards, but a bit too zippy for small ones)

  • Wait indication when calculating

  • Introduce other algorithms (besides Warnsdorf's rule)

  • Add the abilty to select a finishing square

  • Indicate to the user if case is unsolvable (ie no complete tour possible)

  • Solve closed Knight's Tours

credit

Thanks to the authors of these react components, which are used in the app:

react-measure

react-highlight

Further reading and resources

http://gaebler.us/share/Knight_tour.html

http://www.tri.org.au/knightframe.html

http://www.sciencedirect.com/science/article/pii/S0166218X04003488

http://www.sciencedirect.com/science/article/pii/S0166218X96000108

http://algorithms.tutorialhorizon.com/backtracking-knights-tour-problem/

About

Exploration of knight's tours on arbitrary board sizes up to 26x26

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published