Metadata-Version: 2.4
Name: rustoku
Version: 0.15.1
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Games/Entertainment :: Puzzle Games
Classifier: License :: OSI Approved :: MIT License
Summary: High-performance Sudoku solver and generator in Rust with Python bindings
Keywords: sudoku,puzzles,solver,generator,rust,pyo3
Author-email: Samuel Huang <samhuang91@gmail.com>
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/huangsam/rustoku
Project-URL: Documentation, https://github.com/huangsam/rustoku/blob/main/docs/python.md
Project-URL: Repository, https://github.com/huangsam/rustoku
Project-URL: Issues, https://github.com/huangsam/rustoku/issues
Project-URL: Changelog, https://github.com/huangsam/rustoku/blob/main/CHANGELOG.md

# rustoku

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/huangsam/rustoku/ci.yml)](https://github.com/huangsam/rustoku/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/huangsam/rustoku/blob/main/LICENSE)

High-performance Sudoku solving and generation for Python, powered by a core Rust engine.

## Installation

```bash
pip install rustoku
```

## Quick Start

```python
import rustoku

# 1. Generate a puzzle
puzzle = rustoku.generate("medium")
print("Generated puzzle:", puzzle)

# 2. Solve a puzzle
solution = rustoku.solve(puzzle)
print("Solved puzzle:   ", solution)

# 3. Check solution validity
assert rustoku.check(solution)

# 4. Generate with symmetry and difficulty
symmetric = rustoku.generate_advanced(symmetry="rotational180", difficulty="hard")

# 5. Find all solutions (or check for uniqueness)
solutions = rustoku.solve_all(puzzle)
print(f"Found {len(solutions)} solution(s)")

# 6. Step-by-step human technique solve trace
trace = rustoku.solve_steps(puzzle, difficulty="expert")
print(f"Solved in {len(trace)} steps")
```

## Features

- **Blazing Fast**: Solves puzzles in microseconds using bitmask constraint tracking and MRV backtracking.
- **Human-like Techniques**: Explains steps using human solving strategies (Naked/Hidden Singles, Pairs, Triples, Quads, Pointing/Claiming, X-Wing, Swordfish, Jellyfish, Skyscraper, W-Wing, XY-Wing, XYZ-Wing, and AIC).
- **Flexible Generation**: Generate valid, uniquely solvable Sudoku boards across multiple difficulty levels (`easy`, `medium`, `hard`, `expert`) and symmetry modes (`rotational180`, `rotational90`, `mirrorvertical`, `mirrorhorizontal`, `mirrordiagonal`).

## Documentation

For full API documentation and advanced usage, see the [Python Guide](https://github.com/huangsam/rustoku/blob/main/docs/python.md) in the GitHub repository.

