GitXplorerGitXplorer
a

suds

public
0 stars
0 forks
8 issues

Commits

List of commits on branch main.
Unverified
ab2f292a4175111d8385e6ebd5586ae829ca287f

Bump actions/setup-python from 4.3.0 to 4.6.1

ddependabot[bot] committed 2 years ago
Unverified
49612d1d7f9f1a3c43c946704f29332412ebe613

Bump pytest from 7.2.1 to 7.3.1

ddependabot[bot] committed 2 years ago
Unverified
4c9cde53808cb91954aeb3a4f323140f6cf27bf1

Bump covdefaults from 2.2.2 to 2.3.0

ddependabot[bot] committed 2 years ago
Unverified
428238cd8ab37861c26081324113e0fe57f07485

Bump toshimaru/auto-author-assign from 1.6.1 to 1.6.2

ddependabot[bot] committed 2 years ago
Unverified
512766606016866e2a05538b38ede066cf7046df

Bump pytest from 7.2.0 to 7.2.1

ddependabot[bot] committed 2 years ago
Unverified
b1e64211c183ac4e7a464e69d71b0d4b24250f5a

Bump coverage from 6.5.0 to 7.1.0

ddependabot[bot] committed 2 years ago

README

The README file for this repository.

Suds

pre-commit.ci status Coverage codecov Total alerts Language grade: Python Code Scanning - Action

A sudoku solver

Overview

Suds is a simple sudoku solver. It doesn't aim to be the fastest or best. Don't expect it to be able to solve anything but the easiest sudokus. Suds really exists for me to play around with Python, how to setup the infrastructure around a Python application, and so forth. It's a playground for me to learn rather than a best of breed solver.

Usage

git clone git@github.com:abadger/suds.git
cd suds
python -m suds FILENAME.json

FILENAME.json contains a json data structure with a sudoku board. It should look something like this:

{"board":
    {"rows":
        [
            [0, 0, 7, 0, 0, 0, 0, 0, 6],
            [0, 6, 0, 8, 0, 0, 2, 0, 5],
            [0, 0, 8, 0, 6, 9, 3, 0, 0],
            [7, 0, 6, 0, 3, 8, 1, 0, 0],
            [4, 8, 9, 0, 1, 0, 7, 6, 3],
            [0, 0, 3, 9, 7, 0, 5, 0, 8],
            [0, 0, 5, 6, 8, 0, 4, 0, 0],
            [8, 0, 4, 0, 0, 7, 0, 5, 0],
            [6, 0, 0, 0, 0, 0, 9, 0, 0]
        ]
    }
}

If suds is able to solve the Sudoku puzzle, it will print out the solution and exit with code 0:

The solution is:

3 4 7 5 2 1 8 9 6
9 6 1 8 4 3 2 7 5
5 2 8 7 6 9 3 1 4
7 5 6 4 3 8 1 2 9
4 8 9 2 1 5 7 6 3
2 1 3 9 7 6 5 4 8
1 9 5 6 8 2 4 3 7
8 3 4 1 9 7 6 5 2
6 7 2 3 5 4 9 8 1

If it can't, it will print a message and as much of the board as it was able to fill in. In this case, its exit code will be 1.