Skip to content

two-horned/sudoku-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Solver

This is a Sudoku solver written in the Zig programming language.

Building

The solver can be built with a simple Zig command. The required Zig version is 0.15.1.

zig build --release=fast

The binary is then located at ./zig-out/bin/sudoku.

Running

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

You can also type the puzzles directly into the program, one-by-one.

./zig-out/sudoku

About

Port of my Sudoku solver to Zig.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages