Skip to content

About

A Python function that uses backtracking to solve Sudoku puzzles. Input your puzzle and get the solution instantly.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Sudoku Solver

This is a Python program that solves Sudoku puzzles using a backtracking algorithm. It provides a sudoku_solver function that takes a 9x9 Sudoku puzzle as input and attempts to solve it.

Usage

To use the Sudoku Solver, you need to call the sudoku_solver function and provide a 9x9 puzzle as a list of lists. Each inner list represents a row, and the numbers in the puzzle should be represented as integers. Empty cells are denoted by the number 0.

if __name__ == '__main__':
    puzzle = [[0, 0, 0, 7, 0, 2, 9, 0, 0],
              [0, 9, 0, 0, 8, 1, 2, 0, 9],
              [8, 7, 2, 4, 5, 0, 0, 1, 3],
              [1, 0, 0, 0, 7, 0, 4, 2, 0],
              [9, 0, 0, 1, 0, 5, 0, 0, 8],
              [0, 4, 0, 0, 0, 0, 5, 6, 0],
              [0, 3, 5, 8, 0, 4, 0, 9, 6],
              [0, 8, 0, 0, 3, 6, 7, 0, 0],
              [0, 0, 0, 5, 0, 0, 0, 3, 2]]

    sudoku_solver(puzzle)

About

A Python function that uses backtracking to solve Sudoku puzzles. Input your puzzle and get the solution instantly.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages