Sudokugen
Package for solving and generating sudoku puzzles!
Setup
$ pip install sudokugen
or
$ git clone https://github.com/g-k-l/sudoku-gen.git
$ cd sudoku-gen
$ pip install .
Usage
Solver
>>> from sudokugen.solver import solve
>>> my_puzzle = [[0, 3, 6, 8, 9, 2, 7, 1, 5],
[5, 0, 2, 0, 7, 1, 9, 0, 3],
[9, 0, 7, 5, 6, 3, 4, 8, 2],
[0, 4, 3, 1, 5, 8, 2, 0, 7],
[8, 5, 9, 6, 0, 7, 1, 3, 0],
[7, 2, 0, 9, 3, 4, 8, 5, 6],
[0, 0, 0, 2, 8, 6, 5, 0, 1],
[0, 0, 0, 3, 1, 0, 0, 4, 9],
[0, 0, 0, 7, 4, 9, 3, 2, 8]]
>>> solution = solve(my_puzzle)
And solution looks like:
[[4, 3, 6, 8, 9, 2, 7, 1, 5],
[5, 8, 2, 4, 7, 1, 9, 6, 3],
[9, 1, 7, 5, 6, 3, 4, 8, 2],
[6, 4, 3, 1, 5, 8, 2, 9, 7],
[8, 5, 9, 6, 2, 7, 1, 3, 4],
[7, 2, 1, 9, 3, 4, 8, 5, 6],
[3, 9, 4, 2, 8, 6, 5, 7, 1],
[2, 7, 8, 3, 1, 5, 6, 4, 9],
[1, 6, 5, 7, 4, 9, 3, 2, 8]]
Puzzle Generator
from sudokugen.generator import generate, Difficulty
new_puzzle = generate(difficulty=Difficulty.MEDIUM)
Difficulty refers to the number of cells which have values assigned in the beginning. For MEDIUM, this number is 24.
Metadata
Release files for sudokugen 0.2.1
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 | Actions |
|---|---|---|---|---|
| sudokugen-0.2.1.tar.gz | 6.2 kB | Without provenance | Details for sudokugen-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sudokugen-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for sudokugen-0.2.1-py3-none-any.whl |
Total release size: 26.2 kB
Release files / sudokugen-0.2.1.tar.gz
| Download URL | sudokugen-0.2.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27ab57d427516b49569ec0b9f0dfcedfb0016a40e168ba68b9fac24cb6109d92
|
|
BLAKE2b-256 checksum How to use checksums |
8f2683e382e5328039a8b5e470caaa1776a6e0a312a744188c3bd89495ef56fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.9
|
Release files / sudokugen-0.2.1-py3-none-any.whl
| Download URL | sudokugen-0.2.1-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fec4e67f3a687fb3081e6a4b6ea1c258a80bc7940ca4e3cf150017e541efc18f
|
|
BLAKE2b-256 checksum How to use checksums |
70e803a7b4a788465b02c2f10a93c87cbc7d321fc8a62144af806d939566fbf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.9
|
Security for sudokugen 0.2.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.