Giter Club home page Giter Club logo

sudoku-solver's Introduction

sudoku-solver

A simple Sudoku puzzle solver written in PHP.

๐Ÿšจ NOTE: This project is still under construction. ๐Ÿšจ

Installation

Run the following in the root of the projec to install sudoku-solver.

composer install

Terminology

Square      One of the m x n values on the puzzle board
Row         Horizontal M squares
Column      Vertical N squares
Region      An m x n subset of squares
Group       M/N number of squares in a row (horizontally or vertically) 

Strategies for Solving Puzzles

The strategies used by this solver are based on the strategies as described by Sudoku Dragon.

The Strategies

Strategies should be repeatedly applied until the puzzle is solved.

  1. Only Choice Rule

    • Scan each row, column and region for a single choice in the group.
  2. Single Possibility Rule

    • Scan each intersecting row and column for a single choice in the group.
  3. Only Square Rule

    • Scan each row/column with two empty cells.
    • Identify the two missing numbers, A and B.
    • Scan each intersecting row, column or region and try to eliminate option A.
    • If option A can be eliminated for a particular cell, fill in option B in that cell.
    • Fill in option A in the other empty cell.
  4. Two out of Three Rule

    • From the top down, scan three rows or columns at a time for a particular number starting at 1.
  5. Sub-group exclusion rule

    • TODO
  6. Brute Force

    • Try all options until a solution is found :)

Resources

sudoku-solver's People

Contributors

angelomelonas avatar justintimez avatar

Watchers

 avatar  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.