A Python package to create a pair of solve and unsolve sudoku.
Project description
A Python Package To Create A Pair Of Solve And Unsolve Sudoku.
Usage
Import Sudoku In You Code As
from sudoku import *
There Are Two Method.
- create()
- display()
1. create()
Method create() Take level As A Input Parameter.
level Should As
- easy
- medium
- hard
- extreme
And Return A Two Variable Unsolve Sudoku And Solve Sudoku
Puzzle, Solution = create('easy')
print(Puzzle)
[[0, 3, 0, 6, 5, 1, 0, 4, 7],
[6, 0, 1, 2, 4, 0, 9, 3, 0],
[2, 4, 7, 9, 3, 8, 0, 0, 0],
[0, 9, 3, 0, 6, 0, 1, 2, 4],
[0, 6, 5, 1, 0, 0, 7, 9, 3],
[1, 2, 4, 0, 9, 3, 0, 0, 5],
[4, 0, 9, 3, 0, 6, 5, 1, 0],
[0, 8, 6, 0, 1, 2, 4, 0, 9],
[5, 1, 0, 4, 7, 9, 0, 8, 0]]
print(Solution)
[[9, 3, 8, 6, 5, 1, 2, 4, 7],
[6, 5, 1, 2, 4, 7, 9, 3, 8],
[2, 4, 7, 9, 3, 8, 6, 5, 1],
[7, 9, 3, 8, 6, 5, 1, 2, 4],
[8, 6, 5, 1, 2, 4, 7, 9, 3],
[1, 2, 4, 7, 9, 3, 8, 6, 5],
[4, 7, 9, 3, 8, 6, 5, 1, 2],
[3, 8, 6, 5, 1, 2, 4, 7, 9],
[5, 1, 2, 4, 7, 9, 3, 8, 6]]
Here Puzzle Is Unsolve Sudoku In Form Of Matrix. And Solution Is Solve Sudoku Of Puzzle.
2. display()
Method display() Take Sudoku As A Input Parameter. Which Chould Be Solve Or Unsolve.
Display Puzzle
display(Puzzle)
Output:
* - - - | - - - | - - - *
| 0 3 0 | 6 5 1 | 0 4 7 |
| 6 0 1 | 2 4 0 | 9 3 0 |
| 2 4 7 | 9 3 8 | 0 0 0 |
| - - - | - - - | - - - |
| 0 9 3 | 0 6 0 | 1 2 4 |
| 0 6 5 | 1 0 0 | 7 9 3 |
| 1 2 4 | 0 9 3 | 0 0 5 |
| - - - | - - - | - - - |
| 4 0 9 | 3 0 6 | 5 1 0 |
| 0 8 6 | 0 1 2 | 4 0 9 |
| 5 1 0 | 4 7 9 | 0 8 0 |
* - - - | - - - | - - - *
Display Solution
display(Solution)
Output
* - - - | - - - | - - - *
| 9 3 8 | 6 5 1 | 2 4 7 |
| 6 5 1 | 2 4 7 | 9 3 8 |
| 2 4 7 | 9 3 8 | 6 5 1 |
| - - - | - - - | - - - |
| 7 9 3 | 8 6 5 | 1 2 4 |
| 8 6 5 | 1 2 4 | 7 9 3 |
| 1 2 4 | 7 9 3 | 8 6 5 |
| - - - | - - - | - - - |
| 4 7 9 | 3 8 6 | 5 1 2 |
| 3 8 6 | 5 1 2 | 4 7 9 |
| 5 1 2 | 4 7 9 | 3 8 6 |
* - - - | - - - | - - - *
Source Code Github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sudoku-create-0.0.1.tar.gz.
File metadata
- Download URL: sudoku-create-0.0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d3ef1a1d45bbd4a06e8f56ba83c894c65d353d364da230f7c0f8e8445a87e2
|
|
| MD5 |
eaf7540fa15799cf244ca06858289db3
|
|
| BLAKE2b-256 |
30cb51b71b6fa2eb07c92b8a7fa6b6f8d51e8b1cd7d858fcd8a64165129959b6
|
File details
Details for the file sudoku_create-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sudoku_create-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df7ce1e4a9dbc25a8c7a98a89ba60e5e28dc2374470be210b21a25909d071416
|
|
| MD5 |
f2e63e58b6407fdb8e31864f741b3225
|
|
| BLAKE2b-256 |
d6c9c520cecdb97483e67d1147e2d3e0213e8f09970de2600634250531f1a547
|