This release is a pre-release and may not be stable for production use.
sudokulib is a collection of tools that are useful for generating solutions to Sudoku puzzles. It uses a recursive backtracking algorithm (originally written by Jeremy Brown, Cel Destept), and is capable of generating a 3x3 Sudoku in ~0.015 seconds. It can also generate 4x4 Sudokus in ~0.100 seconds (sometimes longer).
Some 5x5 grids have been generated in a matter of seconds using this library, but I’ve also seen the program run for hours without successfully generating a 5x5. Anything beyond 5x5 always seems to take a long time.
You can solve Sudoku puzzles using this library by calling the init_grid method of an instance of Sudoku. This method takes two types of values. Where n is the grid size:
a 1-dimensional list with n^4 values
a multi-dimensional list with n^2 lists with n^2 values each. Each list represents a row in the grid
The values in the list(s) provided to init_grid must be numeric and greater than 0 but less than n^2 in order to appear in the starting grid. Any other values will be ignored, and the puzzle will be solved with no consideration for such values.
The library also provides utilities for generating starting grids, so you can play Sudoku instead of just generating solutions. There are several difficulty levels to choose from.
Also included in the distribution is a sample class for generating “jigsaw” variations of Sudoku. This class will occasionally generate solvable grids within a second or two, but it takes much longer more often than not.
Metadata
Release files for sudokulib 0.6a
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sudokulib-0.6a.tar.gz | 40.0 kB | Without provenance | Details |
Release files / sudokulib-0.6a.tar.gz
| Download URL | sudokulib-0.6a.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2b9910bb23348b5b7a6a473b7e2f8a1ed968b082378cf21594de003f1c8bed5
|
|
BLAKE2b-256 checksum How to use checksums |
99386a3d57f74a6e633665bbcfdcdf4d7d41cced009be53542074a8b10aaf512
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sudokulib 0.6a
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.