Python based Sudoku generator that can create unique Sudoku board based on 4 difficulty levels. This code also includes a brute force Sudoku solver that is capable of solving even the most difficult Sudoku puzzles!
For a Windows system with git bash use the following commands to set up an virtual python environment.
python -m venv venv
source venv/Scripts/activate
pip install -r requirements.txt
To adjust the difficulty level of the generated Sudoku puzzle, browse to sudoku.py and change the variable 'level' to the desired difficulty levels, which include Easy
, Medium
, Hard
and Insane
.
To adjust the size of the generated Sudoku set the variable 'size' to an value from 2 or higher.
The standard Sudoku size value is 3
.
This means a
size | number range |
---|---|
2 | 1 ... 4 |
3 | 1 ... 9 |
4 | 1 ... 16 |
5 | 1 ... 25 |
... | ... |
To adjust the amount of created Sudokus set the variable 'amount' to desired quantity.
To adjust the way of output, set the variables 'print_console' and 'export_excel' to True
or False
.
python sudoku.py
B.Y.O.T (bring your own tests)
No longer active as of 2024
See more at www.callmejoe.net Made by Joe Carlson 2015