Skip to content

pxeemo/sudoku-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sudoku solver

This is a simple solver for Sudoku Game written in Python. Note that it just solves level easy of Sudoku

Installation

Just clone this repository:

git clone https://github.com/pexemo/sudoku-solver.git
cd sudoku-solver

Requirments are:

  • Python
  • NumPy

Usage

First make a text file like sample file (or just edit it) and enter your board data.

SYNOPSIS

python main.py [-u show unsolved] file

Example:

$ python3 main.py sample_board.txt

Your solved board:

┏━━━┯━━━┯━━━┳━━━┯━━━┯━━━┳━━━┯━━━┯━━━┓
┃ 9 β”‚ 6 β”‚ 3 ┃ 8 β”‚ 1 β”‚ 7 ┃ 5 β”‚ 4 β”‚ 2 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 8 β”‚ 7 β”‚ 1 ┃ 5 β”‚ 4 β”‚ 2 ┃ 6 β”‚ 9 β”‚ 3 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 2 β”‚ 4 β”‚ 5 ┃ 9 β”‚ 3 β”‚ 6 ┃ 8 β”‚ 1 β”‚ 7 ┃
┣━━━┿━━━┿━━━╋━━━┿━━━┿━━━╋━━━┿━━━┿━━━┫
┃ 5 β”‚ 3 β”‚ 9 ┃ 4 β”‚ 6 β”‚ 1 ┃ 7 β”‚ 2 β”‚ 8 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 4 β”‚ 1 β”‚ 6 ┃ 7 β”‚ 2 β”‚ 8 ┃ 3 β”‚ 5 β”‚ 9 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 7 β”‚ 8 β”‚ 2 ┃ 3 β”‚ 5 β”‚ 9 ┃ 1 β”‚ 6 β”‚ 4 ┃
┣━━━┿━━━┿━━━╋━━━┿━━━┿━━━╋━━━┿━━━┿━━━┫
┃ 3 β”‚ 2 β”‚ 7 ┃ 6 β”‚ 9 β”‚ 5 ┃ 4 β”‚ 8 β”‚ 1 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 1 β”‚ 5 β”‚ 4 ┃ 2 β”‚ 8 β”‚ 3 ┃ 9 β”‚ 7 β”‚ 6 ┃
┠───┼───┼───╂───┼───┼───╂───┼───┼───┨
┃ 6 β”‚ 9 β”‚ 8 ┃ 1 β”‚ 7 β”‚ 4 ┃ 2 β”‚ 3 β”‚ 5 ┃
┗━━━┷━━━┷━━━┻━━━┷━━━┷━━━┻━━━┷━━━┷━━━┛

About

A simple python sudoku solver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages