Skip to content

Algorithms which validate a Sudoku Puzzle and solve it. Developed in Python3.

Notifications You must be signed in to change notification settings

AdityaPujara23/Sudoku-Solver

Repository files navigation

Sudoku-Solver

Algorithms which validate a 9x9 Sudoku Puzzle and solve it. Developed in Python3.

Usage

Convert Sudoku

  • Convert your Sudoku into an array list as follows:

image

to:

[["5","3",".",".","7",".",".",".","."] ,["6",".",".","1","9","5",".",".","."] ,[".","9","8",".",".",".",".","6","."] ,["8",".",".",".","6",".",".",".","3"] ,["4",".",".","8",".","3",".",".","1"] ,["7",".",".",".","2",".",".",".","6"] ,[".","6",".",".",".",".","2","8","."] ,[".",".",".","4","1","9",".",".","5"] ,[".",".",".",".","8",".",".","7","9"]]

Place your Sudoku as the one to solved

  • Clone this repository using: git clone https://github.com/AdityaPujara23/Sudoku-Solver.git

  • Change your directory in the terminal to the downloaded repo

  • Copy your converted Sudoku to the following file: sudoku.json

where it states: "sudoku" = [["5","3",".",".","7",".",".",".","."] ,["6",".",".","1","9","5",".",".","."] ,[".","9","8",".",".",".",".","6","."] ,["8",".",".",".","6",".",".",".","3"] ,["4",".",".","8",".","3",".",".","1"] ,["7",".",".",".","2",".",".",".","6"] ,[".","6",".",".",".",".","2","8","."] ,[".",".",".","4","1","9",".",".","5"] ,[".",".",".",".","8",".",".","7","9"]]

change this to: "sudoku" = //your converted sudoku//

where //your converted sudoku// is the sudoku you wish to solve!

Watch the magic take place!

  • Run the following command in your terminal to validate and solve the sudoku: python3 valandsolve.py
  • If your Sudoku is valid, it will present the solution on the screen!

About

Algorithms which validate a Sudoku Puzzle and solve it. Developed in Python3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages