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.2.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

solvesudoku-0.0.2-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solvesudoku-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6de9d7bfb9a021746869df51585acb261012b3e10c92ed7c3d91d5305376a35c
MD5 c43dc42264a117edb0ad681922c425bc
BLAKE2b-256 bfee44164ff6589ba5290393f259e5a930a8c2849230f1932df913c8bdd88db9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solvesudoku-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93342567acd1209e6c211566c48888a67393f4e2881c9968aa2bb766871056aa
MD5 58790df50c4063dc90c5915116ec39e0
BLAKE2b-256 7ea0018b33f6fda06de37f0de3803850bf6e6ec494cc119f1de04420f13a949d

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