Rustoku
Lightning-fast Sudoku solving and generation, crafted in Rust.
Rustoku is a highly optimized Sudoku puzzle solver and generator built with a focus on speed and clarity. It leverages bitmasking for constraint tracking and a backtracking algorithm with MRV for puzzle navigation. Try the demo in your browser, or install the Rust library and CLI crates.
- Fast solving with clear solve paths: Rustoku can find solutions in microseconds, even for the most complex puzzles. Plus, it shows you the step-by-step solve path for understanding how the solution was reached
- Unique and configurable puzzle generation: Create Sudoku puzzles that are guaranteed to have only one solution. You can also customize the difficulty of the puzzle to your liking
- Human-like puzzle solving: Beyond raw speed, it mimics human expertise, employing a full range of techniques from Naked Singles to X-Wing to solve puzzles with precision
- Multi-platform access: Use Rustoku as a Rust library or CLI, run it in the browser via the
rustoku-wasmcrate or call it from Python viarustoku-py, or try the live demo
Documentation
Comprehensive guides are available for all distribution channels:
- CLI User Guide - Reference for terminal usage.
- Library User Guide - For Rust developers using
rustoku-lib. - WebAssembly Guide - Browser-side integration.
- Python Guide - Using the engine from Python.
Getting Started
Commands to get you going:
# This installs the binary at $HOME/.cargo/bin
# Generate puzzles
# Solve puzzles
# Check solutions
# Display puzzle
Example output from the show command:
+-------+-------+-------+
| 9 . . | 5 . 7 | 4 . . |
| . . 7 | . 8 . | . . . |
| 8 3 . | 4 . 1 | . . 6 |
+-------+-------+-------+
| 4 . 2 | . . . | 3 . . |
| . 9 . | . . . | . 6 5 |
| . . . | . 5 . | . 8 . |
+-------+-------+-------+
| 2 . . | 9 . 8 | . . . |
| . 8 . | . 7 4 | . . . |
| 7 . . | 2 1 . | 8 . 3 |
+-------+-------+-------+
Line format: 900507400007080000830401006402000300090000065000050080200908000080074000700210803
Try some more examples from these sites:
Dive into the world of high-performance Sudoku today!