Skip to content

Programa em python que resolve os puzzles de Sudoku.

Notifications You must be signed in to change notification settings

slamcoderpt/Sudoku-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku-Solver

Programa em python que resolve os puzzles de Sudoku usando Backtracing Algorithm.

Como utilizar:

# Importar class
from sudokusolver import SudokuSolver

# Muda para o teu puzzle
board = [[8, 0, 0, 2, 0, 6, 0, 7, 3],
         [0, 0, 6, 0, 4, 0, 0, 0, 0],
         [0, 0, 5, 0, 0, 0, 9, 0, 0],
         [0, 1, 0, 4, 0, 0, 0, 6, 0],
         [0, 0, 7, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 8, 0, 1, 0, 7],
         [4, 7, 9, 0, 3, 0, 0, 0, 5],
         [0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 8, 7, 0, 0, 2, 1, 0]]

# Criar objeto 
game = Sudoku Solver(board)

# Verifica se foi resolvido
isSolved = game.solve(0, 0)

if isSolved:
  # Mostrar a solução
  game.print_board()
else:
  # Algo correu mal
  print("Não foi possivel solucionar!")

About

Programa em python que resolve os puzzles de Sudoku.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages