Skip to content
/ sudoku Public

This is one of my first hobby projects. It was a console application that solves Sudoku puzzles. Recently, I've added a module for recognizing Sudoku puzzles from uploaded images and a web interface using Flask

License

Notifications You must be signed in to change notification settings

NikGor/sudoku

Repository files navigation

SUDOKU SOLVER

This is a simple sudoku solver written in python. It uses a backtracking algorithm to solve the puzzle.

Usage

To use the solver, simply run the following command:

sudoku filename

where filename is the name of the file containing the sudoku puzzle. The file should be a text file with the following format:

The puzzle should be entered as 81 characters, with '*' representing an empty cell. divided into 9 rows of 9 characters each. For example, the following puzzle:

5*3****7*
*1*3*98**
****4****
**1*****9
*****6***
*9*2*83**
**74*2*8*
*2**6****
****1*4**

the program can highlight the input with colours:

green - if the empty cell has only one possible value

yellow - if the empty cell has two possible values

red - if the empty cell has three possible values

white - if the empty cell has more than three possible values

the result will be printed using a 3x3 grid format:

-------------------------
| 5 4 3 | 6 8 1 | 9 7 2 |
| 7 1 6 | 3 2 9 | 8 4 5 |
| 2 8 9 | 7 4 5 | 6 3 1 |
-------------------------
| 8 7 1 | 5 3 4 | 2 6 9 |
| 4 3 2 | 1 9 6 | 7 5 8 |
| 6 9 5 | 2 7 8 | 3 1 4 |
-------------------------
| 9 6 7 | 4 5 2 | 1 8 3 |
| 1 2 4 | 8 6 3 | 5 9 7 |
| 3 5 8 | 9 1 7 | 4 2 6 |
-------------------------

Demo

asciicast

License

This project is licensed under the MIT License - see the LICENSE file for details

example workflow

About

This is one of my first hobby projects. It was a console application that solves Sudoku puzzles. Recently, I've added a module for recognizing Sudoku puzzles from uploaded images and a web interface using Flask

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published