Skip to content

Files

Latest commit

 

History

History
68 lines (59 loc) · 1.83 KB

readme.md

File metadata and controls

68 lines (59 loc) · 1.83 KB

Sudoku Solver

A CLI to solve Sudoku puzzles using deduction and backtracking, made with Rust.

To Run:

$ cargo run

Please enter the puzzle as a sequence of 81 numbers.
Use '0' to indicate an empty space.
You may include line breaks, but no other whitespace.
Press enter on an empty line when you are done.

410036000
007000850
600000000
090000200
006070008
000000091
002014000
000003000
740008509


Input:
-------------------------------------
| 4 | 1 |   |   | 3 | 6 |   |   |   |
-------------------------------------
|   |   | 7 |   |   |   | 8 | 5 |   |
-------------------------------------
| 6 |   |   |   |   |   |   |   |   |
-------------------------------------
|   | 9 |   |   |   |   | 2 |   |   |
-------------------------------------
|   |   | 6 |   | 7 |   |   |   | 8 |
-------------------------------------
|   |   |   |   |   |   |   | 9 | 1 |
-------------------------------------
|   |   | 2 |   | 1 | 4 |   |   |   |
-------------------------------------
|   |   |   |   |   | 3 |   |   |   |
-------------------------------------
| 7 | 4 |   |   |   | 8 | 5 |   | 9 |
-------------------------------------


Solution:
-------------------------------------
| 4 | 1 | 5 | 8 | 3 | 6 | 9 | 2 | 7 |
-------------------------------------
| 2 | 3 | 7 | 1 | 4 | 9 | 8 | 5 | 6 |
-------------------------------------
| 6 | 8 | 9 | 2 | 5 | 7 | 1 | 3 | 4 |
-------------------------------------
| 3 | 9 | 8 | 4 | 6 | 1 | 2 | 7 | 5 |
-------------------------------------
| 1 | 2 | 6 | 9 | 7 | 5 | 3 | 4 | 8 |
-------------------------------------
| 5 | 7 | 4 | 3 | 8 | 2 | 6 | 9 | 1 |
-------------------------------------
| 9 | 6 | 2 | 5 | 1 | 4 | 7 | 8 | 3 |
-------------------------------------
| 8 | 5 | 1 | 7 | 9 | 3 | 4 | 6 | 2 |
-------------------------------------
| 7 | 4 | 3 | 6 | 2 | 8 | 5 | 1 | 9 |
-------------------------------------