A Tkinter-based puzzle game based on Euler's Knight Problem, where the objective is to visit every square on the board exactly once using a knight's move.
- Easy Mode: Shows possible knight moves.
- Expert Mode: No visual hints—challenge your memory and planning!
- Grid Size Selector: Choose from 5x5 to 8x8 boards.
- Timer: Track how long it takes you to complete the puzzle.
- Interactive UI: Click to place and move the knight.
- Rules Panel: In-game help available anytime.
- The knight moves in an "L" shape: 2 cells in one direction and 1 cell perpendicular.
- The goal is to visit every cell exactly once.
- The game ends if no valid moves are left and some cells are still unvisited.
- Make sure Python 3.11.9 (or compatible) is installed on your system with Tkinter.
- Clone the repository:
git clone https://github.com/ElliotKoch/Knight-Tour-Problem.git cd Knight-Tour-Problem
- Create and activate a virtual environment:
- On macOS/Linux:
python -m venv .venv source .venv/bin/activate
- On Windows:
python -m venv .venv .venv\Scripts\activate
- On macOS/Linux:
- Install the dependencies:
pip install -r requirements.txt
- Run the game:
python main.py
-
Knight Image:
Included at./images/black-chess-knight.png
Source – Black Chess Figure (Freepik) -
Solution Images:
Pictures for the solutions of all grids are included in the./solutions
directory.
-
Knight Move:
mh2o – Freesound -
Lose Sound:
Unlistenable – Freesound -
Win Sound:
LittleRobotSoundFactory – Freesound
- Scoreboard with best times.
Elliot Koch
📧 kochelliotpro@gmail.com
MIT License