Qeens Game Solver is a graphical puzzle solver built with Python using the Tkinter library. The program solves a modified Queens problem with constraints: exactly one queen per row, column, and color region, with no two queens in adjacent rows are placed in adjacent columns.
The board is loaded from a .txt file where each cell contains a letter representing its color region.
When a solution is found, the program will:
- Displays the board visually
- Shows execution time and number of cases tried
- Allows saving the solution as .txt or .png file
If no solution exists, a notification message is shown.
- Python 3.x
- Operating System: Windows or Linux with display support
tkinter(usually comes with Python installation)Pillowrandom(built-in standard library)
-
Ensure Python 3.x is installed on your system
Check installation:
Windows:
python --version
Linux/macOS:
python3 --version
-
Install required packages:
pip install Pillow
or
pip3 install Pillow
-
Clone or download this repository:
git clone https://github.com/gabriellaalubis/Tucil1_13524006.git cd Tucil1_13524006
For Linux Users, if tkinter is not installed by default, install it using:
sudo apt install python3-tkor
sudo dnf install python3-tkinterThis project does not require compilation. Python files are interpreted at runtime.
-
Navigate to the project directory:
cd Tucil1_13524006 -
Run the main program:
Windows:
python src/core.py
Linux/macOS:
python3 src/core.py
-
The application window will open showing the "QUEENS GAME SOLVER" interface
-
Click the file selection button to choose a game board file (.txt format). The board file should contain:
- A square grid of alphabetic characters representing regions
- Each line represents a row
- Characters are space-separated or continuous
- Must have exactly n distinct characters for an n×n board
Example:
or
A A C C A A C D B B C D B C C DAACC AACD BBCD BCCD
-
Click 'Solve', the program will:
- Validate the board format
- Find the solution to the Queens problem
- Display the live process visually
- Show the queens' positions on the board
Gabriella Botimada Lubis
13524006