Commit Graph

6 Commits

Author SHA1 Message Date
ddidderr 5f45d9f73f docs: add empty Sudoku example
Add a fully blank 9x9 Sudoku input alongside the harder sample puzzles. This
fixture gives maintainers a simple way to exercise parser handling for all-zero
cells and to observe the solver's deterministic fill order when no givens are
present.

The example does not change solver behavior. It expands the documented example
set used for manual command-line checks.

Test Plan:
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo +nightly fmt
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo run -- sudoku-examples/empty.sudoku

Refs: none
2026-04-25 21:19:40 +02:00
ddidderr 55f5136040 chore: separate Cargo lint configuration
Keep the workspace lint configuration in its own Cargo metadata table
instead of letting it follow the dependency table directly. This makes the
manifest layout explicit for future dependency additions and keeps lint policy
visibly separate from package dependencies.

There is no runtime behavior change. Users should see the same binary behavior,
while maintainers get a clearer manifest structure.

Test Plan:
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo +nightly fmt
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests

Refs: none
2026-04-25 21:19:08 +02:00
ddidderr 682470a241 docs: add extreme Sudoku example
Transcribe the extreme 9x9 Sudoku puzzle from the provided image into the
plain-text example format accepted by the solver. This gives users another
ready-made input for exercising sparse puzzles from the command line.

Update the README example commands so the new file is visible alongside the
existing hard puzzle.

Test Plan:
- cargo run -- sudoku-examples/extreme.sudoku

Refs: none
2026-04-25 21:08:54 +02:00
ddidderr 73d8afc8d3 docs: add hard Sudoku example
Transcribe the hard 9x9 Sudoku puzzle from the provided image into the
plain-text example format accepted by the solver. The new example gives users a
ready-made input file for manual CLI checks.

Document the example directory in the README project decomposition and include a
command showing how to run the solver against this puzzle.

Test Plan:
- cargo run -- sudoku-examples/hard.sudoku

Refs: none
2026-04-25 21:05:31 +02:00
ddidderr 06918ea670 feat: implement deductive Sudoku solver
Add a command-line Sudoku solver that reads a whitespace-separated puzzle file,
uses zeroes as empty cells, and prints a solved grid. The parser accepts any
square Sudoku size whose block shape is also square, including 9x9 with 3x3
blocks and 16x16 with 4x4 blocks.

The solver represents candidate sets as u128 bit masks and precomputes row,
column, block, and peer relationships for each cell. It repeatedly applies
human-style deterministic deductions by placing naked singles and hidden singles.
When those deductions stall, it falls back to a constrained trial search: choose
the unsolved cell with the fewest candidates, try high-impact values first, and
resume deduction after each assumption.

The public library API keeps parsing, solving, and formatting testable outside
the CLI. The README documents usage and the top-down project decomposition so
future changes have an architectural map.

Known limitation: the solver returns one valid completion for puzzles with
multiple solutions; it does not currently prove uniqueness.

Test Plan:
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo test
- cargo +nightly fmt
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo run -- /tmp/sudoku-ai-smoke.txt
- timeout 5 cargo run -- /tmp/sudoku-ai-underconstrained.txt

Refs: none
2026-04-25 20:57:44 +02:00
ddidderr 87a53c09bc chore: add Rust project scaffold
Add the initial Cargo package, formatter configuration, ignore rules, lockfile,
and placeholder binary entry point. This establishes the repository baseline so
future solver work can be reviewed as focused behavior changes.

The scaffold intentionally contains no Sudoku behavior yet. It only captures the
starting point of the project as generated and configured locally.

Test Plan:
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo +nightly fmt
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests

Refs: none
2026-04-25 20:53:53 +02:00