This is a Sudoku solver written in the Zig programming language.
The solver can be built with a simple Zig command. The required Zig version is 0.15.1.
zig build --release=fastThe binary is then located at ./zig-out/bin/sudoku.
Each Sudoku puzzle is represented by a single line of 81 characters.
These characters represent the cells in the Sudoku grid. If a value
is set, write respective character [1-9] at its position.
If a cell is empty, indicate this by writing a dot [.] symbol.
These puzzles can then be passed into stdin, for example via by cat-ing
file contents or echo-ing the puzzle.
# Solving a single puzzle with the echo command
echo "..43..2.9..5..9..1.7..6..43..6..2.8719...74...5..83...6.....1.5..35.869..4291.3.." | ./zig-out/bin/sudoku
# Solving a bunch of puzzles written in a file
cat ./puzzle-file | ./zig-out/bin/sudokuYou can also type the puzzles directly into the program, one-by-one.
./zig-out/sudoku