A minimal yet powerful Sudoku puzzle generator and solver implementation in JavaScript.
- Generates unique Sudoku puzzles with varying difficulty
- Solves puzzles using optimized backtracking algorithm
- Counts number of solutions for a given puzzle
- Web-based UI with progress tracking
- Export results in TXT and CSV formats
Inspired by the article "Nerd Sniped: A Sudoku Story" by T-Dillon, this implementation uses:
- Bitwise operations to track cell candidates
- Efficient backtracking with constraint propagation
- Recursive depth-first search with pruning
- Web Workers for parallel puzzle generation
- Responsive UI that works on mobile and desktop
- Real-time progress tracking
- Clipboard export functionality
- Clone the repository
- Install dependencies:
npm install - Run development server:
npm run dev - Open
http://localhost:3000in your browser
├── src/
│ ├── board.js - Bitboard implementation and core Sudoku logic
│ ├── solver.js - Backtracking solver with pruning
│ ├── puzzleGenerator.js - Puzzle generation logic
│ ├── worker.js - WebWorker for parallel generation
│ └── main.js - UI and coordination logic
├── index.html - Main application interface
- Add unit tests (could use Jest or similar framework)
- Implement CI/CD pipeline (GitHub Actions)
- Add ESLint/Prettier config for consistent code style
- Consider adding difficulty level controls
- Improve mobile UI/UX with dedicated styling
Special thanks to:
- T-Dillon's Sudoku Solver Article for algorithm inspiration
- FileSaver.js for client-side export functionality
MIT License