Skip to main content

package to generate and solve sudoku puzzles

Project description

Sudoku-py-lib: create sudoku puzzles

Sudoku-py-lib is a Python package that allows creation of sudoku puzzles from scratch.

Features

  • Generation of random sudoku puzzles
  • Solving of puzzles
  • Uploading custom puzzle grids

Installation

You can download and install sudoku-py-lib with pip:

  pip install sudoku-py-lib

Links

Dependencies

numpy==1.24.2

Usage/Examples

Creating puzzle

from sudoku import SudokuHandler 

sudoku_handler = SudokuHandler()  # Initialize handler object
sudoku_handler.generate()   # Generate new completed sudoku
sudoku_handler.prepare_for_solving(cells_to_remove=10)  # Prepare sudoku for solving by removing specified amount of cells.

print(sudoku_handler.get_puzzle())  # Returns prepared sudoku as 2D list

Solve existing puzzle

from sudoku import SudokuHandler 

sudoku_handler = SudokuHandler()  # Initialize handler object
sudoku_handler.solve_grid(grid)   # Processes sudoku grid and solves it.

print(sudoku_handler.completed_grid  # Returns completed sudoku as 2D list

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

Sudoku-py-lib-1.0.8.tar.gz (7.9 kB view details)

Uploaded Source

File details

Details for the file Sudoku-py-lib-1.0.8.tar.gz.

File metadata

  • Download URL: Sudoku-py-lib-1.0.8.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for Sudoku-py-lib-1.0.8.tar.gz
Algorithm Hash digest
SHA256 0c61e90a7e00a3f1b2a5e485d50e8896e18960ac6414594f3a097b09dfbafac2
MD5 e852c9dba365adda4219603a7c265c0f
BLAKE2b-256 b3a8235c5fcd56a315d6cef7dda9f2165111acfeeecd6d76a7c4cb87b06d14a0

See more details on using hashes here.

Supported by

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