Nineties Pop Music

    js-sudoku

    1.0.10 • Public • Published

    sudoku

    version typescript umd esm cmd npm bundle size (version) GitHub Repo stars

    Live Demo

    demo

    Usage

    In Browser

    Locally…

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

    … or Directly from CDN. In which case you don't even need to install.

    <script src="https://unpkg.com/js-sudoku@latest/dist/index.js"></script>
    // generate sudokuList to show
    const list = sudoku.gen({ gzip: false, mask: false, level: sudoku.Level.LOW });
    // verify users result
    const isValid = sudoku.verify(list);

    Install

    npm install js-sudoku
    # or
    yarn add js-sudoku

    es model...

    import { gen, Level } from 'js-sudoku';
    const list = gen({ gzip: false, mask: false, level: Level.LOW });

    ...node

    const { gen, Level } = require('js-sudoku');
    const list = gen({ gzip: false, mask: false, level: Level.LOW });

    type

    enum Level {
        LOW,
        MIDDLE,
        HIGH
    }
    
    type sudokuList = number[][];
    
    interface genOptions {
        mask?: boolean;
        gzip?: boolean;
        level?: Level;
    }

    Methods

    gen: (opt: genOptions) => sudokuList | string;
    params type description
    mask boolean random position fill 0
    gzip boolean gzip result
    level Level degree of difficulty working when mask
    verify: (list: sudokuList) => boolean;
    params type description
    list sudokuList none

    Support By

    Jetbrains

    Install

    npm i js-sudoku

    DownloadsWeekly Downloads

    11

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    4.21 kB

    Total Files

    3

    Last publish

    Collaborators

    • happy-func