Sudoku Solver
Enter your puzzle and click Solve
Technical Features
3x3 Subgrid Styling: The CSS uses the
:nth-childselector to apply thicker borders every 3 cells and rows. This creates the visual "blocks" essential for reading Sudoku.Input Filtering: The
oninputJavaScript listener ensures that users can only type single digits (1-9). It prevents "0" and multi-digit numbers from breaking the logic.Recursive Search: The
solve()function is a depth-first search. It attempts a number and immediately moves to the next empty spot, only returningfalse(backtracking) if a placement becomes impossible.Visual Feedback: Solved numbers are assigned a
.solvedclass, which changes their color and triggers a subtle background animation so you can see what the AI filled in versus what you started with.