Skip to main content

Solves Sudoku within seconds.

Project description

Sudoku Solver

Solves Sudoku within seconds. The Sudoku can be given manually in the output screen or from a file.

This package also contains other functions on lists, that are useful to solve a Sudoku.

Sudoku Format

Blank cells should be given as '-' and the number of characters should be 9. Press Enter after giving 9 characters, to enter the next row in Sudoku. If 9 characters are not given or the given characters are not unique, a warning will be given to re-enter the row.

Overall, the format of the Sudoku should be as follows:

    15-8--7-2
    -3--5----
    --72--5--
    -----1-9-
    -2--89---
    9-----18-
    36---2--4
    --4-6-9--
    -9-----61

Functions

Main function:

  • solveSudoku - Used to solve the Sudoku.

Other useful functions:

  • get_sudoku - Imports Sudoku from a text file.
  • prompt_sudoku - Prompts the Sudoku.
  • blocks_has_duplicates - Checks if the Sudoku blocks have duplicates or not.
  • blockify - Converts 9x9 Sudoku list into a list containing lists of values in the block of the given Sudoku.
  • vertically_has_duplicates - Checks whether the given collection of lists have duplicate values at the same indexes or not.
  • list_difference - Difference between two lists.
  • list_intersection - Intersection between two lists.
  • combo_recursion - Recursion function used to calculate all the combinations of a list.
  • all_combinations - Uses the 'combo_recursion' function inside a loop, that iterates through the given list.
  • block_number - Gives the block number in which the given row and column numbers intersects in a Sudoku.
  • value_inserts - Inserts the given list of possible missing values inside the given original list, at the positions where the values are missing inside the original list.
  • insert_combos - Tries all combinations of missing elements and inserts to a list and returns it.
  • vertical - Transpose of a nx9 list.
  • list_duplicates_of - Predicts the indexes of duplicate elements inside a list.

Refer the Documentation for more info.

Source Code and Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solvesudoku-0.0.3.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

solvesudoku-0.0.3-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file solvesudoku-0.0.3.tar.gz.

File metadata

  • Download URL: solvesudoku-0.0.3.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for solvesudoku-0.0.3.tar.gz
Algorithm Hash digest
SHA256 aa994b699e74c730357e18152a7a8af891c397350393bf98688a78a479dd215e
MD5 7544a2bfc13eee212aae542195fc5ece
BLAKE2b-256 94986cca72b195c521dd789164ce8f854d76012907188245307c482ce576b215

See more details on using hashes here.

File details

Details for the file solvesudoku-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: solvesudoku-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for solvesudoku-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 25194e5c70708cb8954cc8fff5296e8ab66d058a2f1b0ee717c17a6196cf2b96
MD5 96a1254b27e1d4d75b2e9e6e32f3cc8e
BLAKE2b-256 3bfd6f76cabb29bf0a0b418bfd11b0a44b0129685da99693177241131b32e5c5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page