"How does the knight move?" - Alexandra Botez
This Python program uses the Tkinter library to create a simple chessboard where you can explore the distances a chess knight can move from a selected square. It visualizes these distances by coloring the squares on the board based on the number of knight's moves required to reach them.
If you prefer running the program as an executable on UNIX systems, follow these steps:
-
Download the latest release from the Releases page.
-
Open a terminal and navigate to the directory where you downloaded the file.
-
Make the executable file (
regui
) executable by running:chmod +x regui
-
Run the program by executing:
./regui
If you want to run the program from the source code, follow these steps:
-
Clone this repository to your local machine using
git clone
. -
Make sure you have Python 3.x installed.
-
Install the required libraries using pip or any other package menager of you choice :
pip install numpy python-chess
-
Run the program by executing:
python regui.py
I've also developed a web-based version. You can access it online by visiting http://menitm.pythonanywhere.com/.
Please note that while the web version is functional, it may benefit from some design enhancements, primarily for mobile browsers. It's not currently responsive for smaller screens, and there's room for styling improvements. Your feedback on potential design improvements is always welcome!
The program calculates the knight's distance for each square on the chessboard using a 2D NumPy array. It then maps these distances to colors to create a visual representation of the knight's movement range.
This program was created by me as a simple visualization tool for understanding how chess knights move on a chessboard.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: Contributions are welcome! If you'd like to improve the program or add new features, please open an issue or create a pull request.