Skip to content

dillanspencer/Sudoku-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku-Solver

forthebadge made-with-python

Solves any game of Sudoku from Sudoku.com

Table Of Contents:

How It Works

Installation

Usage

How It Works

  1. Creates an image of each tile on the Sudoku board using PyAutoGUI
  2. Uses OpenCV to create an Image threshold to use in the character recognition step.
  3. Using character recognition, determine the number in each image. To recognise digits and store them in a NumPy array, PyTesseract is used.
  4. Solves the Sudoku Puzzle using a recursive backtracking algorithm.
  5. Tracks the user's mouse and determines which tile has been clicked.
  6. Using Pyttsx3 the program will yell out the answer of the current tile such that the user can input the answer into the board.

Installation

  1. Download and install Python3 from here

  2. Download and install Google's Tesseract from here

  3. I recommend using virtualenv. Download virtualenv by opening a terminal and typing:

    pip install virtualenv
  4. Create a virtual environment with the name sudokuenv.

    • Windows
    virtualenv sudoku
    cd sudoku/Scripts
    activate
    • Linux:
    source sudoku/bin/activate
  5. Clone this repository, extract it if you downloaded a .zip or .tar file and cd into the cloned repository.

    • For Example:
    cd C:\Sudoku-Solver-master
  6. Install the required packages by typing:

    pip install -r requirements.txt

Usage

Setup For Use

  • First things first open up Sudoku.com.
  • Once you run the program there is a 3 second interval where you can make your way to the webpage.
  • Be sure to scroll all the way to the top of the page so that the images can be taken of the tiles correctly.
  • Make sure the volume is turned up so you can hear the program's current stage. When the sound "Let's play some sudoku" plays, you can press on any tile on the board to hear what value should be put there.

Running The Program

To run the program:

  python3 solver.py

About

Solves any game of Sudoku from Sudoku.com

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages