Giter Club home page Giter Club logo

sudoku_solver's Introduction

Sudoku Solver

This is an implementation of a sudoku solver using the Crook's Algorithm written in rust.

Features

It can solve every level of sudoku puzzle.

It first attempts to solve without using guessing by using forced cells and then applying preemptive sets as per the paper.

If it cannot be solved and requires gussing, the puzzle is solved using backtracking (commonly known as brute-forcing).

Usage

To run it locally, run

git clone https://github.com/blood-rogue/sudoku_solver.git
cd sudoku_solver

cargo r -r

Then provide the entire board as one line.

Note: I used . in the example for blanks but you can use any character other than 1 to 9 for blank spaces

Example

Testing

It is tested on 5 levels with 100 challenges each

  • easy
  • medium
  • hard
  • expert
  • evil

You can run all tests by running (You need to clone it first)

$ cargo test

Or can run the test individually for each difficulty by running

# Replace <difficulty> with one of the above levels
$ cargo test test_<difficulty>

You can find the test puzzles in the test/puzzles directory.

Inspirations

Note: The link to Damien's blog seems to be broken. web archive

sudoku_solver's People

Contributors

bismitpanda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.