Skip to main content

pysudo

Installation Instructions

use pip or pip3 to install the library.

pip install pysudo

Importing

from pysudo import solve

Example of usage:

problem = [[6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 2],
           [0 , 0 , 1 , 7 , 9 , 0 , 0 , 3 , 0],
           [0 , 5 , 0 , 0 , 6 , 2 , 0 , 0 , 0],
           [0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 5],
           [0 , 0 , 0 , 3 , 0 , 8 , 0 , 0 , 0],
           [2 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
           [0 , 0 , 0 , 1 , 3 , 0 , 0 , 5 , 0],
           [0 , 8 , 0 , 0 , 5 , 7 , 1 , 0 , 0],
           [5 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 6]]

solved = solve(problem)

The empty cells in the Sudoku puzzle are to be filled by 0.

solved is an array having 9 arrays of row inside it representing the complete solved puzzle.

To visualize output use :

for rows in solved :
  print(rows)

Output

[6, 7, 9, 4, 1, 3, 5, 8, 2]
[8, 2, 1, 7, 9, 5, 6, 3, 4]
[3, 5, 4, 8, 6, 2, 9, 7, 1]
[7, 3, 6, 9, 4, 1, 8, 2, 5]
[1, 9, 5, 3, 2, 8, 4, 6, 7]
[2, 4, 8, 5, 7, 6, 3, 1, 9]
[4, 6, 7, 1, 3, 9, 2, 5, 8]
[9, 8, 2, 6, 5, 7, 1, 4, 3]
[5, 1, 3, 2, 8, 4, 7, 9, 6]

Metadata

Release files for pysudo 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysudo 1.1.0
File Size Uploaded
pysudo-1.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysudo 1.1.0
File Interpreter ABI Platform
pysudo-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / pysudo-1.1.0.tar.gz

Download URL pysudo-1.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2a18b7126d2fa97020fa62f28f0c06cc7e1ef92d2b6dd1437bfd68f399ac404d
BLAKE2b-256 checksum
How to use checksums
1bafc98838ab75ca49bbb6ad240b1331d94b547c3090e2442010efddbbde537d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.20.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.8

Release files / pysudo-1.1.0-py3-none-any.whl

Download URL pysudo-1.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a8fc4a7336e2bcd7f3fbf2d43124fe3b73c644698a9695d766f6de0e97eceef
BLAKE2b-256 checksum
How to use checksums
14fbc2dcd9f07cf019753b98167f77df9f6066226176d2a85e8ea13afd7779da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.20.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page