Skip to content

itzmidinesh/sudoku-solver-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sudoku-solver-python

This python script will solve sudoku puzzles.

Input

Input is given as a nested list consisting of 9 lists which contain the initial values of the puzzle and zero for empty values.

For Eg.

puzzle = [[5,3,0,0,7,0,0,0,0],
          [6,0,0,1,9,5,0,0,0],
          [0,9,8,0,0,0,0,6,0],
          [8,0,0,0,6,0,0,0,3],
          [4,0,0,8,0,3,0,0,1],
          [7,0,0,0,2,0,0,0,6],
          [0,6,0,0,0,0,2,8,0],
          [0,0,0,4,1,9,0,0,5],
          [0,0,0,0,8,0,0,7,9]]

You can change the input puzzle at the top of the file sudoku.py

Output

Output is printed to the console.

Setup

$ git clone https://github.com/itzmidinesh/sudoku-solver-python.git
$ cd sudoku-solver-python
$ python sudoku.py

Example

This is a screenshot of the script in action