Skip to content

mryingster/sudokuSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

SudokuSolver

A console based soduko puzzle solver written in C.

Description

This is a simple commandline-based utility to solve sudoku puzzles. The main code was originally developed for Project Euler #96, but has been repurposed to facilitate user entry of unsolved puzzles.

Usage

SudokuSolver can be run in a terminal, and the user will be prompted to enter the incompleted sudoku puzzle 1 row at a time (9 digits), substituting unknown values for '0'. (eg 001060050).

Alternatively, a puzzle may be redirected to SudokuSolver from a file, using this syntax: ./sudokuSolver < test.txt

Sample Puzzle File

800000000
003600000
070090200
050007000
000045700
000100030
001000068
008500010
090000400

Sample Output

 8     |       |      
     3 | 6     |      
   7   |   9   | 2    
-------+-------+-------
   5   |     7 |      
       |   4 5 | 7    
       | 1     |   3  
-------+-------+-------
     1 |       |   6 8
     8 | 5     |   1  
   9   |       | 4    


 8 1 2 | 7 5 3 | 6 4 9
 9 4 3 | 6 8 2 | 1 7 5
 6 7 5 | 4 9 1 | 2 8 3
-------+-------+-------
 1 5 4 | 2 3 7 | 8 9 6
 3 6 9 | 8 4 5 | 7 2 1
 2 8 7 | 1 6 9 | 5 3 4
-------+-------+-------
 5 2 1 | 9 7 4 | 3 6 8
 4 3 8 | 5 2 6 | 9 1 7
 7 9 6 | 3 1 8 | 4 5 2

About

A console based soduko puzzle solver written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages