Introduction

Below are links to the javascript used on these Sudoku pages. There are also links to the Python scripts usedby an earlier version.

sudoku.js

Solves Standard Sudokus. Follows the same algorithm as described in the Python version, below.

SudokuConstructor.js

Constructs standard Sudokus.

SudokuVariantConstructor.js

Constructs Variant Sudokus.

SuSolver

This implements the 5 phases described on the solver page (except the first part of phase 3, looking for numbers that only appear twice and in pairs). This solves all the examples I have tried.

When it can't solve a puzzle using the first 4 phases it enters phase 5 which is intended to enumerate the possible solutions (on the assumption that there are more than one). If there is only 1 solution which isn't found after the first 4 phases then phase 5 will find it. I currently don't have any examples where there is a single unique solution that can't be found using the first 4 phases.

MakeSudoku

This implements a Sudoku creating algorithm. There is currently no explanation, you will have to figure it out for yourself. It can be used to create some of the non-standard examples.

SuSolverExamples

The test data for SuSolver.

More information about running Python scripts can be found on the Python Patterns page.

Other pages

(c) John Whitehouse 2013 - 2023