sudoku-printable-js
v1.0.0
Published
Generate and solve Sudoku puzzles with multiple difficulty levels
Downloads
126
Maintainers
Readme
sudoku-puzzle-generator
Generate printable Sudoku puzzles with multiple difficulty levels in JavaScript.
Features
- Generate valid Sudoku puzzles (9x9)
- Multiple difficulty levels: Easy, Medium, Hard, Expert
- Puzzle validation and solving
- SVG/HTML output for printing
- Unique solutions guaranteed
- Batch puzzle generation
Installation
npm install sudoku-puzzle-generatorUsage
const { generatePuzzle, solvePuzzle, validatePuzzle } = require('sudoku-puzzle-generator');
// Generate an easy puzzle
const puzzle = generatePuzzle('easy');
console.log(puzzle.grid); // 9x9 array (0 = empty)
// Solve a puzzle
const solution = solvePuzzle(puzzle.grid);
console.log(solution); // Solved 9x9 array
// Validate a completed puzzle
const isValid = validatePuzzle(solution);
console.log(isValid); // trueLive Demo
Try the full-featured Sudoku Printable generator online.
License
MIT
