Skip to content

A puzzle game based on Euler's Knight Problem, built with Python and Tkinter. Challenge yourself to visit every square on a board exactly once using only legal knight moves.

License

Notifications You must be signed in to change notification settings

ElliotKoch/Knight-Tour-Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♞ Knight's Problem Game

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.

🎮 Features

  • 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.

🧠 Rules

  • 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.

🛠 Installation

  1. Make sure Python 3.11.9 (or compatible) is installed on your system with Tkinter.
  2. Clone the repository:
    git clone https://github.com/ElliotKoch/Knight-Tour-Problem.git
    cd Knight-Tour-Problem
  3. 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
  4. Install the dependencies:
    pip install -r requirements.txt
  5. Run the game:
    python main.py

📁 Assets

🖼️ Images

  • 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.

🎵 Sounds

✅ TODO

  • Scoreboard with best times.

👤 Author

Elliot Koch
📧 kochelliotpro@gmail.com

📄 License

MIT License

About

A puzzle game based on Euler's Knight Problem, built with Python and Tkinter. Challenge yourself to visit every square on a board exactly once using only legal knight moves.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages