Getting Started
Prerequisites
To compile and execute AlphaSudokuGo, you will require:
- A C++ compiler that supports C++11 or later.
- A clone of this repository (it is recommended to exclude the images folder due to its large size).
- Qt5 (optional, for the GUI) and its dependencies.
- SFML (optional, for the GUI) and its dependencies.
- CMake (optional, for building the project).
- A terminal or command prompt.
If you don't have some of the required libraries installed, you can use homebrew
to install them. For Qt5
:
brew install qt5
For SFML
:
brew install sfml
For CMake
:
brew install cmake
If you don't have homebrew
installed, please follow the instructions on the Homebrew website.
For the interactive Jupyter notebook, you will require:
- Jupyter Notebook
- Python 3
- Matplotlib
Compiling and Running the Project
After installing the required libraries and cloning the repository, you can compile and run the project using the following commands:
cd sudoku-solver
cmake ..
make
Then you can run the project using the following command, with the optional flags --difficulty
and --open
:
./SudokuGame --difficulty <number of missing cells> --open <path to sudoku puzzle>
Without the optional --open
, the program will initiate in a game mode with a randomly generated solvable Sudoku puzzle. You can modify the puzzle's level using the command line flag --difficulty
, followed by the number of missing cells you want in the puzzle. The default difficulty level is set to 40 missing cells.
Interacting with the GUI
Click on the cell you wish to modify, each click will increment the cell value by 1. To erase a cell value, just right-click on the cell. To solve the puzzle in AI mode, press the middle mouse button (scroll wheel), and watch the solution unfold.
Click on the cell you wish to modify and watch the solution unfold
You can also change the theme of the game, including fonts and styles. In order to change font you will need to download a .ttf
file and place it in the program directory. Then you can change the font by modifying the font
variable in the Sudoku.cpp file. To change the style of the game, you can modify the backgroundColor
, numberColor
, and cellSize
variables in the Sudoku.cpp
file.
In the following video, you can see the usage on the left, and different Space
theme options on the right.
Contributing
Any contributions you make are greatly appreciated.
License
This project is licensed under the MIT License - see the LICENSE file for details.