Sit back, relax, and let your Sudoku puzzles be solved using brute-force. This simple Python CLI tool allows you to input puzzles directly or provide a file path for automatic solving.
Before getting started, ensure you have the following installed:
The following contains instruction for getting this application running locally:
- Clone the repository.
git clone https://github.com/ImSeanConroy/sudoku-cracker.git
cd sudoku-cracker
- Create and start virtual environment
python3 -m venv env
source env/bin/activate
- Install dependencies
pip3 install -r requirements.txt
- Run script
python main.py --cubes cube1 cube2 cube3 cube4 cube5 cube6 cube7 cube8 cube9
The Sudoku Cracker allows you to input your Sudoku puzzle as 9 groups of 3x3 numbers. Each group represents a 3x3 cube, and the numbers are separated by commas. Use 0
for empty cells.
Solve puzzle from a set of cubes (input directly):
python main.py --cubes 003500160 029700005 100000009 049000050 000006010 000250006 000008000 050037000 080002001
Solve puzzle from a text file where each line represents a row of the puzzle and each number is seperated by a space:
python main.py --file "examples/example.txt"
Example file format (example.txt):
0 0 3 0 2 9 1 0 0
5 0 0 7 0 0 0 0 0
1 6 0 0 0 5 0 0 9
0 4 9 0 0 0 0 0 0
0 0 0 0 0 6 2 5 0
0 5 0 0 1 0 0 0 6
0 0 0 0 5 0 0 8 0
0 0 8 0 3 7 0 0 2
0 0 0 0 0 0 0 0 1
Solve puzzle from a image. Ensure that the image contains only the Sudoku puzzle and is centered and extends as close to the image’s edges as possible for optimal recognition (example.png):
python main.py --image "examples/example.png"
Solve puzzle from a set of rows (input directly):
python main.py --rows "..."
Disable Color Output:
python main.py --cubes "..." --no-color
Disable Runtime Display:
python main.py --cubes "..." --no-runtime
Disable Column and Row Seperators:
python main.py --cubes "..." --no-seperators
- Run the following command to run the full test suit:
pytest tests/
This project is Distributed under the MIT License - see the LICENSE file for information.
If you are having problems, please let me know by raising a new issue.