#Sudoku-Solver This is a recursive Sudoku solver that can solve any valid Sudoku puzzle in less than a second
import os
import numpy as np
from selenium import webdriver
from tkinter import *
from tkinter import ttk
Big picture overview of all the files:
grid.py
: Contains the grid and does most of the solving
solver.py
: Contains the GUI and initializes the grid, main run method RUN THIS to access the solver
web.py
: Scrapes a puzzle from online
Clear
: Clears the puzzle
Solve
: Solves the puzzle
Web Sudoku
: Loads a random puzzle from websudoku.com
Input
: Simply input numbers into each cell in the Grid
Output
: The Grid outputs the solution, with given numbers as black and all other numbers as red.
If a solution is not found or the puzzle is invalid, the Grid will append all non-numeric cells with a red X.
Please note that if there are multiple solutions to a puzzle, the program will only output one.
- You MUST have a google chrome driver as an environment variable named, by default
CHROME
. If you wish to have a driver with a different name, changeline 12
inweb.py
to:
driver_name = '<driver name>'
Note if you do not do this, there will be an error - Invalid puzzles or inputs are handled by printing red X's
- Determine number of solutions to a puzzle
- Make sudoku puzzles with the program