https://github.com/hungrybluedev/sudoku
A Sudoku Solver application written in Python.
https://github.com/hungrybluedev/sudoku
Last synced: about 1 year ago
JSON representation
A Sudoku Solver application written in Python.
- Host: GitHub
- URL: https://github.com/hungrybluedev/sudoku
- Owner: hungrybluedev
- License: mit
- Created: 2020-01-01T22:28:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-02T17:51:43.000Z (over 6 years ago)
- Last Synced: 2025-02-14T18:36:24.831Z (over 1 year ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sudoku
A self-contained Python program that can solve Sudoku puzzles using traditional techniques as well as backtracking.
Coming Soon:
1. Playable game loop where the user can play Sudoku in the terminal.
2. A GUI for the app.
## Status
This is currently a work in progress and needs a lot of polish in terms of its API as well as unit tests. Currently it does indeed solve _all_ possible valid Sudoku states. However, it relies heavily on backtracking and is very slow. I am in the process of implementing the traditional Sudoku solving algorithms in the code.
Expect lots of refactoring and breaking changes by the time this is stable.
## Usage
```python
from sudoku import Sudoku
# The input string can be prettified or simply
# an 81-character long string with digits for
# given values and dots for unknowns
input_string = """ . . . | . . . | . . .
. . . | . 2 9 | . 8 .
. 7 4 | . . 5 | . . 2
-------+-------+-------
. . . | . . . | . 1 .
9 . 3 | . . 7 | . . .
6 . 7 | . 3 . | . 4 8
-------+-------+-------
. . . | . 9 . | . . 3
. 6 5 | . . . | . . .
. 4 . | 2 . . | 6 . ."""
sudoku = Sudoku(input_string)
print(sudoku)
sudoku.solve()
print(sudoku)
```
## License
[MIT License](/LICENSE)