js-sudoku-generator
Javascript Sudoku sheet generator
Dependencies
- node js (https://nodejs.org/)
Installation
- install via npm:
npm install js-sudoku-generator --save
Build instructions
- install dependencies via: npm install
- build with webpack via: webpack --config webpack.prod.js
- Once library is built, in the "dist" folder, you will find both node (dist/js-sudoku-generator.js) / web (dist/js-sudoku-generator.web.js) version of the lib.
inclusion
NodeJS
const SudokuGenerator = SudokuGenerator;
Web
code examples
// generate sudoku solution boards, single argument is the number of boardsSudokuGenerator; // get difficulty sheets let l_oFirstBoard = SudokuGeneratorgeneratedBoards0; // get sheet signature (for loading)console; // load saved board let l_oLoadedBoard = SudokuGenerator; // get hard difficulty sheetlet l_aHardSheet = l_oFirstBoard; // get medium difficulty sheetlet l_aMediumSheet = l_oFirstBoard; // get easy difficulty sheetlet l_aEasySheet = l_oFirstBoard; // pretty print solution to consolel_oFirstBoard; // pretty print sheetl_oFirstBoard;