Create Completed Sudokus
Output Readme Download Replit Sel. & Copy Full


This repl generates a completed sudoku puzzle using constraint propagation.

To view this on TripleLog, click here.

This code is an adaption of Peter Norvig's sudoku solver.


Choose the size of the puzzle and then click the Create button. The output does look nice but you can see that something works.


Add CSS by editing the style.css file that is linked to in the head section or inline edit the style section in the head.


The script.js will generate a completed sudoku puzzle of the desired size.

Every puzzle will have the same top row with the numbers in order. These values can (and should) be shuffled. To generate an actual puzzle you will also need to do more work to figure out which cells to remove.

If you want to generate lots of puzzles you probably want to make it faster.