Skip to content

A CLI tool for creating and solving sudoku at any difficulty.

Notifications You must be signed in to change notification settings

lavantien/sudoku-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku CLI

A CLI tool for solving sudoku puzzle with a blazingly fast speed. Using optimized backtracking: reduce the decision space for each cell before backtracking, even solved the puzzle already without even backtracking.

Build

  • Run make in terminal.

Usage

  • Run ./main in terminal.
  • 0 for single line input
  • 1 for grid input
  • Any other numbers to quit

Input

Dev Logs

Example Run:

1
.5.......
9.41.....
....5...6
..1.27.6.
.43.....2
.9651....
.69....74
...3....9
3.....25.

.5.|...|...
9.4|1..|...
...|.5.|..6
___ ___ ___
..1|.27|.6.
.43|...|..2
.96|51.|...
___ ___ ___
.69|...|.74
...|3..|..9
3..|...|25.

652|734|198
934|168|725
817|952|436
___ ___ ___
581|427|963
743|896|512
296|513|847
___ ___ ___
169|285|374
425|371|689
378|649|251

Pre-solve count: 10
Recursive count: 0
Execution time: 0.000086
1
.......1.
4........
.2.......
....5.4.7
..8...3..
..1.9....
3..4..2..
.5.1.....
...8.6...

...|...|.1.
4..|...|...
.2.|...|...
___ ___ ___
...|.5.|4.7
..8|...|3..
..1|.9.|...
___ ___ ___
3..|4..|2..
.5.|1..|...
...|8.6|...

693|784|512
487|512|936
125|963|874
___ ___ ___
932|651|487
568|247|391
741|398|625
___ ___ ___
319|475|268
856|129|743
274|836|159

Pre-solve count: 2
Recursive count: 25333461
Execution time: 0.440439
0
....9....2.7...1.96..1.5..45.6.1.9.3...7.9....9..5..4..3.....6..2.9.1.7....8.3...

...|.9.|...
2.7|...|1.9
6..|1.5|..4
___ ___ ___
5.6|.1.|9.3
...|7.9|...
.9.|.5.|.4.
___ ___ ___
.3.|...|.6.
.2.|9.1|.7.
...|8.3|...

413|297|658
257|648|139
689|135|724
___ ___ ___
576|412|983
342|789|516
198|356|247
___ ___ ___
931|574|862
824|961|375
765|823|491

Pre-solve count: 2
Recursive count: 8107
Execution time: 0.000185
0
8..........36......7..9.2...5...7.......457.....1...3...1....68..85...1..9....4..

8..|...|...
..3|6..|...
.7.|.9.|2..
___ ___ ___
.5.|..7|...
...|.45|7..
...|1..|.3.
___ ___ ___
..1|...|.68
..8|5..|.1.
.9.|...|4..

812|753|649
943|682|175
675|491|283
___ ___ ___
154|237|896
369|845|721
287|169|534
___ ___ ___
521|974|368
438|526|917
796|318|452

Pre-solve count: 1
Recursive count: 72097
Execution time: 0.001656

About

A CLI tool for creating and solving sudoku at any difficulty.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published