This program has some fun to it. It has two different approaches (aka finders) to solve sudoku puzzles and it also will colorize the solution as it is solving it, including showing backtracking.
Works best with a black terminal.
go get github.com/mkboudreau/sudoku
make
#optional
#make install
-
Provide a board (3 different ways)
./sudoku < sample
cat sample | ./sudoku
./sudoku <paste in board>
-
Generate a board
./sudoku -g <difficulty>
`-h` Highlights the solution
`-p` Shows the game actually being solved. Very Fun! Enlarge your terminal. :)
`-t <time duration>` Default is "1ms". Slow it down to watch the solution play out, including backtracking. (try 250ms)
`-f <finder>` There are two different next available coordinate finders in the code. The default is "closest" which is faster for any given coordinate, but can be super slow when backtracking a lot. The other one that is implemented is "rank" which will recompute the best available coordinate among remaining available coordinates. This appears to be faster on harder boards.
`-d` Displays the difficulty of the board. Default is true
`-a` Turns on autosolving, so the program will not prompt you to be ready.
`-g <difficulty>` Create new puzzle with diffulty between 1-5 with 5 being the most difficult. Default is 3 (default -1)
`-l <loglevel>` Sets the log level. [off,error,debug,trace] (default "error")
-
Option 1:
./sudoku < sample
-
Option 2:
cat sample | ./sudoku
cat sample | ./sudoku -h
cat sample | ./sudoku -p
cat sample | ./sudoku -p -t 500ms -f rank
./sudoku -g 5
./sudoku -f rank -p -t 250ms -g 5 -a