https://github.com/marstr/pydoku
A quick Sudoku solver to start teaching myself python
https://github.com/marstr/pydoku
python sudoku-solver
Last synced: about 1 month ago
JSON representation
A quick Sudoku solver to start teaching myself python
- Host: GitHub
- URL: https://github.com/marstr/pydoku
- Owner: marstr
- License: mit
- Created: 2018-11-01T18:28:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-07T01:07:11.000Z (over 6 years ago)
- Last Synced: 2025-03-13T15:16:37.783Z (about 2 months ago)
- Topics: python, sudoku-solver
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pydoku
[](https://travis-ci.com/marstr/pydoku)
[](https://pypi.python.org/pypi/pydoku)Sudoku is a mathematical game, where one looks to completely fill a board with numbers, where no values are repeated in
any given row, column, square or square. You can read more about this game on
[Wikipedia](https://en.wikipedia.org/wiki/Sudoku). The most common variant uses a 9x9 grid segmented into nine
3x3 squares, with 9 rows and 9 columns. However, the difficulty of the game can be adjusted by changing the size of the
board. For instance, you can play an easier game in a 6x6 board where each square has 3 columns and 2 rows.This package looks to expose the ability to solve sudoku puzzles with squares of any dimension (given a powerful enough
machine!)## Install
> Minimum supported version of Python: 3.5
Easily install this package using pip!
``` bash
pip install pydoku
```## Usage
Solving a default board with a couple of values inserted:
``` Python
import pydokusubject = pydoku.Board()
subject[0][3] = 6
subject[0][1] = 1
print(subject.solve())# Output:
# -------------------------
# | 2 1 3 | 6 4 5 | 7 8 9 |
# | 4 5 6 | 7 8 9 | 1 2 3 |
# | 7 8 9 | 1 2 3 | 4 5 6 |
# -------------------------
# | 1 2 4 | 3 5 6 | 8 9 7 |
# | 3 6 5 | 8 9 7 | 2 1 4 |
# | 8 9 7 | 2 1 4 | 3 6 5 |
# -------------------------
# | 5 3 1 | 4 6 2 | 9 7 8 |
# | 6 4 2 | 9 7 8 | 5 3 1 |
# | 9 7 8 | 5 3 1 | 6 4 2 |
# -------------------------
```## Contributing
Contributions welcome, if not well monitored. Feel free to send PRs, file issues, etc.
## License
This library is available under the MIT license, the full text can be found [here](./LICENSE). Basically though, go use
it however and for whatever you want, just understand that I'm not liable for issues you encounter.