Git Product home page Git Product logo

sudoku's Introduction

Sudoku

数独解题器

It's a Sudoku solver implemented using backtracking algorithms

How to use?

<script src="./Sudoku.js"></script>

点击单元格预出题,出题完毕后调用解题方法即可解题

Example

<div id="app"></div>
<div class="btn">
    <button onclick="solve()">解题</button>
    <button onclick="reset()">重置</button>
    <button onclick="clean()">清空</button>
</div>

<script src="./Sudoku.js"></script>
<script>

    // 构造解题器
    // 点击单元格预出题
    const sudoku = new Sudoku("#app",{
        checkOblique:false, //是否验证对角不重复
        checkBox:true,      //是否验证宫内不重复
        message:(data) =>{
            console.log(data);  //信息回调
        }
    })

    const solve = sudoku.solve  //解题
    const reset = sudoku.reset  //清空答案重置
    const clean = sudoku.clean  //清空所有

</script>

Options

Property Description type default
checkOblique Enable diagonal non repeating verification Boolean false
checkBox Enable intrauterine non repeated verification Boolean true
message Message callback Function

Functions

Function Name Description
solve Start automatic problem-solving
reset Clear answer reset
clean Clear All

sudoku's People

Contributors

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