Skip to content

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

License

Notifications You must be signed in to change notification settings

pulpdrew/sudoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 |
-------------------------------------

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages